|
2 | 2 |
|
3 | 3 | A data structure is a particular way of organizing and storing data in a computer so that it can be accessed and modified efficiently. More precisely, a data structure is a collection of data values, the relationships among them, and the functions or operations that can be applied to the data.This repository contains **Java** based solutions to many popular data structures from coding interviews pov. |
4 | 4 |
|
| 5 | +### ✅ Data Structure Operations Complexity |
| 6 | + |
| 7 | +| Data Structure | Access | Search | Insertion | Deletion | Comments | |
| 8 | +| ----------------------- | :-------: | :-------: | :-------: | :-------: | :-------- | |
| 9 | +| **Array** | 1 | n | n | n | | |
| 10 | +| **Stack** | n | n | 1 | 1 | | |
| 11 | +| **Queue** | n | n | 1 | 1 | | |
| 12 | +| **Linked List** | n | n | 1 | n | | |
| 13 | +| **Hash Table** | - | n | n | n | In case of perfect hash function costs would be O(1) | |
| 14 | +| **Binary Search Tree** | n | n | n | n | In case of balanced tree costs would be O(log(n)) | |
| 15 | +| **B-Tree** | log(n) | log(n) | log(n) | log(n) | | |
| 16 | +| **Red-Black Tree** | log(n) | log(n) | log(n) | log(n) | | |
| 17 | +| **AVL Tree** | log(n) | log(n) | log(n) | log(n) | | |
| 18 | +| **Bloom Filter** | - | 1 | 1 | - | False positives are possible while searching | |
| 19 | + |
5 | 20 | ### 🗃️ [Arrays](https://github.com/cs-cse/Java-DataStructures/tree/master/dsa-Arrays-Strings/src) |
6 | 21 | * An array is a collection of items stored at contiguous memory locations. The idea is to store multiple items of the same type together. |
7 | 22 | * For simplicity, we can think of an array as a fleet of stairs where on each step is placed a value (let’s say one of your friends). Here, you can identify the location of any of your friends by simply knowing the count of the step they are on. |
@@ -88,19 +103,6 @@ A data structure is a particular way of organizing and storing data in a compute |
88 | 103 | * A node's position in the tree defines the key with which that node is associated, which makes tries different in comparison to binary search trees, in which a node stores a key that corresponds only to that node.All descendants of a node have a common prefix of a String associated with that node, whereas the root is associated with an empty String. |
89 | 104 |
|
90 | 105 |
|
91 | | -### ✅ Data Structure Operations Complexity |
92 | 106 |
|
93 | | -| Data Structure | Access | Search | Insertion | Deletion | Comments | |
94 | | -| ----------------------- | :-------: | :-------: | :-------: | :-------: | :-------- | |
95 | | -| **Array** | 1 | n | n | n | | |
96 | | -| **Stack** | n | n | 1 | 1 | | |
97 | | -| **Queue** | n | n | 1 | 1 | | |
98 | | -| **Linked List** | n | n | 1 | n | | |
99 | | -| **Hash Table** | - | n | n | n | In case of perfect hash function costs would be O(1) | |
100 | | -| **Binary Search Tree** | n | n | n | n | In case of balanced tree costs would be O(log(n)) | |
101 | | -| **B-Tree** | log(n) | log(n) | log(n) | log(n) | | |
102 | | -| **Red-Black Tree** | log(n) | log(n) | log(n) | log(n) | | |
103 | | -| **AVL Tree** | log(n) | log(n) | log(n) | log(n) | | |
104 | | -| **Bloom Filter** | - | 1 | 1 | - | False positives are possible while searching | |
105 | 107 |
|
106 | 108 | ### ⚡ [Continue to Algorithms...](https://github.com/cs-cse/Java-Algorithms) |
0 commit comments