v/vlib/datatypes
2024-01-18 15:31:42 +02:00
..
fsm datatypes.fsm: cleanup notices for fsm.v 2023-12-20 17:52:13 +02:00
bloom_filter.v all: unwrap const() blocks 2023-11-25 10:02:51 +03:00
bloom_filter_test.v all: fix typos (#19693) 2023-10-30 03:28:34 +02:00
bstree.v all: update attributes to use new syntax 2023-11-15 16:16:01 +11:00
bstree_test.v all: fix typos (#19693) 2023-10-30 03:28:34 +02:00
doubly_linked_list.v datatypes: make Direction pub and fix and add tests for push_many (#19983) 2023-11-24 16:10:00 +02:00
doubly_linked_list_test.v datatypes: make Direction pub and fix and add tests for push_many (#19983) 2023-11-24 16:10:00 +02:00
heap.v datatypes: add push_many for doubly and singly linked list + add insert_many for heap (#19975) 2023-11-24 09:40:08 +02:00
heap_test.v datatypes: add push_many for doubly and singly linked list + add insert_many for heap (#19975) 2023-11-24 09:40:08 +02:00
linked_list.v datatypes: add push_many for doubly and singly linked list + add insert_many for heap (#19975) 2023-11-24 09:40:08 +02:00
linked_list_test.v datatypes: add push_many for doubly and singly linked list + add insert_many for heap (#19975) 2023-11-24 09:40:08 +02:00
quadtree.v datatypes,examples: fix typos, and silence notice in the quadtree example (#20577) 2024-01-18 15:31:42 +02:00
quadtree_test.v datatypes: add quadtree, add its demo to examples/ (#16087) 2022-10-18 18:02:44 +03:00
queue.v datatypes: change optional to result (#16546) 2022-11-28 10:24:47 +02:00
queue_test.v datatypes: change optional to result (#16546) 2022-11-28 10:24:47 +02:00
README.md datatypes: add Bloom filter (#18327) 2023-06-02 10:56:22 +03:00
ringbuffer.v datatypes: improve the doc strings for RingBuffer and its methods (#19464) 2023-09-28 19:07:26 +03:00
ringbuffer_test.v all: replace generic <> with [] - part 2 (#16536) 2022-11-26 18:23:26 +02:00
set.v vlib: remove functions and fields, deprecated before 2023-03-20 2023-09-16 17:16:54 +03:00
set_test.v all: replace generic <> with [] - part 2 (#16536) 2022-11-26 18:23:26 +02:00
stack.v datatypes: change optional to result (#16546) 2022-11-28 10:24:47 +02:00
stack_test.v datatypes: change optional to result (#16546) 2022-11-28 10:24:47 +02:00

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:

  • Linked list
  • Doubly linked list
  • Stack (LIFO)
  • Queue (FIFO)
  • Min heap (priority queue)
  • Set
  • Quadtree
  • Bloom filter
  • ...