1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/datatypes
2023-06-02 10:56:22 +03:00
..
fsm
bloom_filter_test.v datatypes: add Bloom filter (#18327) 2023-06-02 10:56:22 +03:00
bloom_filter.v datatypes: add Bloom filter (#18327) 2023-06-02 10:56:22 +03:00
bstree_test.v
bstree.v
doubly_linked_list_test.v
doubly_linked_list.v
heap_test.v
heap.v
linked_list_test.v
linked_list.v
quadtree_test.v
quadtree.v
queue_test.v
queue.v
README.md datatypes: add Bloom filter (#18327) 2023-06-02 10:56:22 +03:00
ringbuffer_test.v
ringbuffer.v
set_test.v
set.v
stack_test.v
stack.v

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
  • ...