Changes to README
This commit is contained in:
parent
49d7ae6c8e
commit
42527dd61e
15
README.md
15
README.md
|
@ -33,9 +33,9 @@ queue.addLeft(-2)
|
|||
queue.pop()
|
||||
|
||||
# Pops and returns the last element in O(1) time
|
||||
discard queue.pop(queue.high())
|
||||
echo queue.pop(queue.high())
|
||||
# This can also be written as
|
||||
discard queue.pop(^1)
|
||||
echo queue.pop(^1)
|
||||
|
||||
# Pops element at position n
|
||||
discard queue.pop(n)
|
||||
|
@ -49,8 +49,8 @@ for e in queue.reversed():
|
|||
echo e
|
||||
|
||||
echo queue.len()
|
||||
5 in queue # false
|
||||
0 in queue # true
|
||||
echo 5 in queue # false
|
||||
echo 0 in queue # true
|
||||
|
||||
# Item accessing works just like regular sequence types in Nim.
|
||||
# Note that the further the item is from either end of the
|
||||
|
@ -106,10 +106,11 @@ some benchmarks as well as the test suite used to validate the behavior of the q
|
|||
## Why? There's std/deques!
|
||||
|
||||
1. I was bored during my programming class
|
||||
2. That only provides a deque based on `seq`s
|
||||
3. The deque in that module is a value type
|
||||
2. std/deques only provides a deque based on `seq`s
|
||||
3. The deque in std/deques is a value type
|
||||
4. The deques in this module allow accessing at arbirary locations
|
||||
5. More useful procs are implemented
|
||||
5. More useful procs are implemented (`find`, `extend`, `extendLeft`, `reversedPairs`, etc.)
|
||||
6. The deques in this module can be restrained in size
|
||||
1. I was bored during my programming class
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue