
Offers deque implementations with features like element popping, peeking, and pushing. Supports non-destructive iteration and provides various deque types with utility methods.
= K-Deque :source-highlighter: highlightjs :gh-group: k-libs :gh-name: k-deque :lib-package: io.klibs.collections :lib-group: io.k-libs :lib-name: deque :lib-version: 0.9.0 :lib-feature: 0.9.0
image:https://img.shields.io/github/license/{gh-group}/{gh-name}[title="License"] image:https://img.shields.io/badge/docs-dokka-ff69b4[link="https://{gh-group}.github.io/{gh-name}/dokka/{lib-feature}/{lib-name}/{lib-package}/index.html"] image:https://img.shields.io/maven-central/v/{lib-group}/{lib-name}[link="https://search.maven.org/artifact/{lib-group}/{lib-name}"]
Pure Kotlin deque implementations.
== Import
== Usage
// Make a deque the hard way! val deque = Deque( initialCapacity = 5, scaleFactor = 2f, maxSize = 32 )
// Make a deque the easy way! val deque = dequeOf(1, 2, 3, 4, 5)
// Pop elements off the front! require(deque.popFirst() == 1)
// Pop elements off the back! require(deque.popLast() == 5)
// Peek at elements! require(deque.peekFirst() == 2) require(deque.peekLast() == 4)
// Push elements onto the deque deque.pushFirst(-1) deque.pushLast(-5)
// Iterate non-destructively! for (value in deque) println(value)
// Again!! deque.peekEach { println(it) }
// In reverse! deque.peekEach(true) { println(it) }
== Version History
This table contains the last 10 versions, for a full list see link:versions.adoc[].
[%header, cols="1m,1m,10"] |=== | Version | Docs | Description
| v0.9.0
| https://{gh-group}.github.io/{gh-name}/dokka/0.9.0/{lib-name}/{lib-package}/index.html[Dokka]
| Add CharDeque. Add copyOf method to all types.
| v0.8.0 | https://{gh-group}.github.io/{gh-name}/dokka/0.8.0/{lib-name}/{lib-package}/index.html[Dokka] | Add constructor functions for all types.
| v0.7.0
| https://{gh-group}.github.io/{gh-name}/dokka/0.7.0/{lib-name}/{lib-package}/index.html[Dokka]
| Add ByteDeque, ShortDeque, IntDeque, LongDeque, UShortDeque, UIntDeque, ULongDeque
| v0.6.2
| https://{gh-group}.github.io/{gh-name}/dokka/0.6.2/{lib-name}/{lib-package}/index.html[Dokka]
| Fix issue with trimToSize method not messing with the head position.
| v0.6.1
| https://{gh-group}.github.io/{gh-name}/dokka/0.6.1/{lib-name}/{lib-package}/index.html[Dokka]
| Fix issue with copyToArray on Deque instances with a size of 1
| v0.6.0
| https://{gh-group}.github.io/{gh-name}/dokka/0.6.0/{lib-name}/{lib-package}/index.html[Dokka]
| Add contentEquals method.
| v0.5.0
| https://{gh-group}.github.io/{gh-name}/dokka/0.5.0/{lib-name}/{lib-package}/index.html[Dokka]
| Add trimToSize() method.
| v0.4.0 | https://{gh-group}.github.io/{gh-name}/dokka/0.4.0/{lib-name}/{lib-package}/index.html[Dokka] | BREAKING! See https://github.com/k-libs/k-deque/releases/tag/v0.4.0[version release notes]!
| v0.3.0
| https://{gh-group}.github.io/{gh-name}/dokka/0.3.0/{lib-name}/{lib-package}/index.html[Dokka]
| Add toArray() method to deques.
| v0.2.0 | https://{gh-group}.github.io/{gh-name}/dokka/0.2.0/{lib-name}/{lib-package}/index.html[Dokka] | Add UByteDeque |===
= K-Deque :source-highlighter: highlightjs :gh-group: k-libs :gh-name: k-deque :lib-package: io.klibs.collections :lib-group: io.k-libs :lib-name: deque :lib-version: 0.9.0 :lib-feature: 0.9.0
image:https://img.shields.io/github/license/{gh-group}/{gh-name}[title="License"] image:https://img.shields.io/badge/docs-dokka-ff69b4[link="https://{gh-group}.github.io/{gh-name}/dokka/{lib-feature}/{lib-name}/{lib-package}/index.html"] image:https://img.shields.io/maven-central/v/{lib-group}/{lib-name}[link="https://search.maven.org/artifact/{lib-group}/{lib-name}"]
Pure Kotlin deque implementations.
== Import
== Usage
// Make a deque the hard way! val deque = Deque( initialCapacity = 5, scaleFactor = 2f, maxSize = 32 )
// Make a deque the easy way! val deque = dequeOf(1, 2, 3, 4, 5)
// Pop elements off the front! require(deque.popFirst() == 1)
// Pop elements off the back! require(deque.popLast() == 5)
// Peek at elements! require(deque.peekFirst() == 2) require(deque.peekLast() == 4)
// Push elements onto the deque deque.pushFirst(-1) deque.pushLast(-5)
// Iterate non-destructively! for (value in deque) println(value)
// Again!! deque.peekEach { println(it) }
// In reverse! deque.peekEach(true) { println(it) }
== Version History
This table contains the last 10 versions, for a full list see link:versions.adoc[].
[%header, cols="1m,1m,10"] |=== | Version | Docs | Description
| v0.9.0
| https://{gh-group}.github.io/{gh-name}/dokka/0.9.0/{lib-name}/{lib-package}/index.html[Dokka]
| Add CharDeque. Add copyOf method to all types.
| v0.8.0 | https://{gh-group}.github.io/{gh-name}/dokka/0.8.0/{lib-name}/{lib-package}/index.html[Dokka] | Add constructor functions for all types.
| v0.7.0
| https://{gh-group}.github.io/{gh-name}/dokka/0.7.0/{lib-name}/{lib-package}/index.html[Dokka]
| Add ByteDeque, ShortDeque, IntDeque, LongDeque, UShortDeque, UIntDeque, ULongDeque
| v0.6.2
| https://{gh-group}.github.io/{gh-name}/dokka/0.6.2/{lib-name}/{lib-package}/index.html[Dokka]
| Fix issue with trimToSize method not messing with the head position.
| v0.6.1
| https://{gh-group}.github.io/{gh-name}/dokka/0.6.1/{lib-name}/{lib-package}/index.html[Dokka]
| Fix issue with copyToArray on Deque instances with a size of 1
| v0.6.0
| https://{gh-group}.github.io/{gh-name}/dokka/0.6.0/{lib-name}/{lib-package}/index.html[Dokka]
| Add contentEquals method.
| v0.5.0
| https://{gh-group}.github.io/{gh-name}/dokka/0.5.0/{lib-name}/{lib-package}/index.html[Dokka]
| Add trimToSize() method.
| v0.4.0 | https://{gh-group}.github.io/{gh-name}/dokka/0.4.0/{lib-name}/{lib-package}/index.html[Dokka] | BREAKING! See https://github.com/k-libs/k-deque/releases/tag/v0.4.0[version release notes]!
| v0.3.0
| https://{gh-group}.github.io/{gh-name}/dokka/0.3.0/{lib-name}/{lib-package}/index.html[Dokka]
| Add toArray() method to deques.
| v0.2.0 | https://{gh-group}.github.io/{gh-name}/dokka/0.2.0/{lib-name}/{lib-package}/index.html[Dokka] | Add UByteDeque |===