0 branches
Tree
Top files
Clone with HTTPS:
bloom_filter.v
fmt: remove the prefixed module name of const names, that are in the same module (related #22183) (#22185)
1 year ago
3.64 KB
doubly_linked_list.v
parser, checker: check generic struct fields and initialisation (fix #26433) (fix #26436) (#26450)
last Jan 27
9.22 KB
doubly_linked_list_test.v
datatypes: fix insert() and delete() for items in second half of DoubleLinkedList[T]{}, add test (#25647)
last Nov 2
5.0 KB
heap.v
datatypes: add push_many for doubly and singly linked list + add insert_many for heap (#19975)
2 years ago
2.52 KB
heap_test.v
datatypes: add push_many for doubly and singly linked list + add insert_many for heap (#19975)
2 years ago
1.41 KB
linked_list_test.v
checker: disallow `foo()? == foo` where foo returns `!string` (fix #26383) (#26403)
last Jan 21
3.56 KB
ringbuffer.v
datatypes: improve the doc strings for `RingBuffer` and its methods (#19464)
2 years ago
3.16 KB
datatypes
This module provides implementations of less frequently used, but still common data types.
V's builtin module is imported implicitly, and has implementations for arrays,
maps and strings. These are good for many applications, but there are a plethora
of other useful data structures/containers, like linked lists, priority queues,
trees, etc, that allow for algorithms with different time complexities, which may
be more suitable for your specific application.
It is implemented using generics, that you have to specialise for the type of your actual elements. For example:
import datatypes
mut stack := datatypes.Stack[int]{}
stack.push(1)
println(stack)
Currently Implemented Datatypes:
- [x] Linked list
- [x] Doubly linked list
- [x] Stack (LIFO)
- [x] Queue (FIFO)
- [x] Min heap (priority queue)
- [x] Set
- [x] Quadtree
- [x] Bloom filter
- [ ] ...