diff --git a/README.md b/README.md index 06c8e60..80bfbed 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ yarn add data-structure-typed ```html - + ``` ```js @@ -97,7 +97,7 @@ bst.get(6); // null bst.isAVLBalanced(); // true bst.BFS()[0] === 11; // true -const objBST = new BST>(); +const objBST = new BST>(); objBST.add(11, {id: 11, keyA: 11}); objBST.add(3, {id: 3, keyA: 3}); @@ -678,89 +678,122 @@ optimal approach to data structure design. +### Standard library data structure comparison + + + + + + + + + + - + + + - - + + + + + + + + + + + + + + + + + + + + + + @@ -768,125 +801,83 @@ optimal approach to data structure design. + - + - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - + + + - - + + - - - + + + + - + - - - - - - - - - - - @@ -894,38 +885,42 @@ optimal approach to data structure design. + + + + + + +
Data Structure C++ STL java.util Python collectionsData Structure Typed
Dynamic Array (ArrayList) std::vector<T> ArrayList<E> listArray
Linked List std::list<T> LinkedList<E> dequeDoublyLinkedList
Set std::set<T> HashSet<E> setSet
Map std::map<K, V> HashMap<K, V> dictMap
Stack std::stack<T> Stack<E> N/AStack
Queue std::queue<T>LinkedList<E>Queue<E> N/AQueue
Priority Queue std::priority_queue<T> PriorityQueue<E> N/APriorityQueue
Hash Table N/AN/Adefaultdict, Counter, etc.HashtabledefaultdictHashTable
Deque std::deque<T> N/A N/ADeque
Multiset std::multiset<T> N/A N/AN/A
Multimap std::multimap<K, V> N/A N/AN/A
Unordered Set std::unordered_set<T> HashSet<E> N/AN/A
Unordered Multisetstd::unordered_multisetN/ACounterN/A
Unordered Map std::unordered_map<K, V> HashMap<K, V>defaultdictN/A
Unordered Multimapstd::unordered_multimap<K, V>N/AN/A N/A
std::bitset<N> N/A N/AN/A
Ordered Dictionary (OrderedDict)Ordered Dictionary N/A N/A OrderedDict
User-Defined DictionaryN/AN/AUserDict
User-Defined ListN/AN/AUserList
User-Defined SetN/AN/AUserSetMap
Double-Ended Queue (Deque) std::deque<T> N/A N/A
Skip ListN/AN/AN/A
Circular QueueN/AN/AN/A
Bit ArrayN/AN/AN/A
Bloom FilterN/AN/AN/ADeque
Linked Hash Set N/A LinkedHashSet<E> N/AN/A
Linked Hash Map N/A LinkedHashMap<K, V> N/AN/A
Sorted Set N/A TreeSet<E> N/AAVLTree, RBTree
Sorted Map N/A TreeMap<K, V> N/AAVLTree, RBTree
Tree Setstd::setTreeSet<E> N/AN/AN/AAVLTree, RBTree
Tree Mapstd::map<K, V>TreeMap<K, V> N/AN/AN/AAVLTree, RBTree
Persistent Collections N/A N/A N/AN/A
std::unordered_multisetstd::unordered_multiset<T>
unordered multisetunordered multiset<T>N/A N/A N/A
std::unordered_multimapUnordered Multimap std::unordered_multimap<K, V> N/A N/A
N/ATreeSet<E>TreeSet<E>N/A
N/ATreeMap<K, V>TreeMap<K, V> N/A
LinkedBlockingQueue<E> N/A N/AN/A
N/A ConcurrentHashMap<K, V> N/A N/AN/A
N/A N/A namedtuple N/AN/A
N/A N/A ChainMap N/AN/A
N/A N/A defaultdict N/AN/A
N/A N/A Counter N/AN/A
- - -
Data StructureC++ STLjava.utilPython collectionsCustom Data Structure (Typescript)
Dynamic Array (ArrayList)std::vector<T>ArrayList<E>listN/A
Linked Liststd::list<T>LinkedList<E>dequeSinglyLinkedList, DoublyLinkedList, etc.
Setstd::set<T>HashSet<E>setTreeMultiset, etc.
Mapstd::map<K, V>HashMap<K, V>dictN/A
Stackstd::stack<T>Stack<E>N/AN/A
Queuestd::queue<T>LinkedList<E>N/AN/A
Priority Queuestd::priority_queue<T>PriorityQueue<E>N/AN/A
Hash TableN/AN/Adefaultdict, Counter, etc.N/A
Dequestd::deque<T>N/AN/AN/A
Multisetstd::multiset<T>N/AN/AN/A
Multimapstd::multimap<K, V>N/AN/AN/A
Unordered Setstd::unordered_set<T>HashSet<E>N/AN/A
Unordered Mapstd::unordered_map<K, V>HashMap<K, V>N/AN/A
Bitsetstd::bitset<N>N/AN/AN/A
Ordered Dictionary (OrderedDict)N/AN/AOrderedDictN/A
User-Defined DictionaryN/AN/AUserDictN/A
User-Defined ListN/AN/AUserListN/A
User-Defined SetN/AN/AUserSetN/A
Double-Ended Queue (Deque)std::deque<T>N/AN/AN/A
Skip ListN/AN/AN/AN/A
Circular QueueN/AN/AN/AN/A
Bit ArrayN/AN/AN/AN/A
Bloom FilterN/AN/AN/AN/A
Linked Hash SetN/ALinkedHashSet<E>N/AN/A
Linked Hash MapN/ALinkedHashMap<K, V>N/AN/A
Sorted SetN/ATreeSet<E>N/AN/A
Sorted MapN/ATreeMap<K, V>N/AN/A
Tree SetN/AN/AN/AN/A
Tree MapN/AN/AN/AN/A
Persistent CollectionsN/AN/AN/AN/A
std::unordered_multisetstd::unordered_multiset<T>N/AN/AN/A
std::unordered_multimapstd::unordered_multimap<K, V>N/AN/AN/A
N/ATreeSet<E>TreeSet<E>N/AN/A
N/ATreeMap<K, V>TreeMap<K, V>N/AN/A
N/ALinkedBlockingQueue<E>N/AN/AN/A
N/AConcurrentHashMap<K, V>N/AN/AN/A
N/AN/AnamedtupleN/AN/A
N/AN/AChainMapN/AN/A
N/AN/AdefaultdictN/AN/A
N/AN/ACounterN/AN/A
diff --git a/test/integration/index.html b/test/integration/index.html index 74f7cdc..f535af0 100644 --- a/test/integration/index.html +++ b/test/integration/index.html @@ -1,13 +1,13 @@ - + - + CDN Test - + -
-
    +
    +
    @@ -36,7 +36,7 @@ last = queue.dequeue(); } - console.log(performance.now() - startTime) + console.log(performance.now() - startTime);