Quick Data Structure Revision
1. ArrayList - Useful for storing data with no unique constraints and unknown size of data set.
Time Complexity:
Time Complexity:
Time Complexity:
Time Complexity:
- Writing - O(1)
 - Reading - O(1)
 - Searching - O(N)
 - Deleting - O(N)
 
2. Array - Useful for storing data with fixed data set. Generally faster than HashSets and ArrayLists. Vast usage of arrays includes: Storing of data, storing count of data, sorting data and binary searching.
Time Complexity:
- Writing - O(1)
 - Reading - O(1)
 - Searching - O(1)
 - Deleting - O(N)
 
3. HashSet - Useful for storing unique values of a data set.
- Writing - O(1)
 - Reading - O(1)
 - Searching - O(1)
 - Deleting - O(1)
 
4. HashMap - Useful for storing unique keys and its values. Values can be any data type of data structure.
Time Complexity:
- Writing - O(1)
 - Reading - O(1)
 - Searching - O(1)
 - Deleting - O(1)
 
5. TreeSet - A Tree Set is a sorted HashSet. The java interpretation includes functions such as TreeSet.ceiling and TreeSet.floor which gets the closest values of the given value.
Time Complexity:
- Writing - O(logN)
 - Reading - O(logN)
 - Searching - O(logN)
 - Deleting - O(logN)
 
6. TreeMap - A Tree Map is a sorted HashMap. The java interpretation includes functions such as TreeMap.ceiling and TreeMap.floor which gets the closest values of the given value.
Time Complexity:
- Writing - O(logN)
 - Reading - O(logN)
 - Searching - O(logN)
 - Deleting - O(logN)
 
7. PriorityQueue - A priority queue can be given a comparator condition to sort the data set. It performs as a priority heap.
Time Complexity:
- Writing - O(logN)
 - Reading - O(logN)
 - Searching - O(logN)
 - Deleting - O(logN)
 
8. LinkedList - A LinkedList is a continuous form a linked data structure.
Time Complexity:
- Writing - O(1)
 - Reading - O(N)
 - Searching - O(N)
 - Deleting - O(1)
 
9. Queue/ArrayDequeue - FIFO data set. Useful for BFS.
Time Complexity:
- Writing - O(1)
 - Reading - O(1)
 - Searching - O(1)
 - Deleting - O(1)
 
10. Stack - LIFO data set. Useful for DFS.
Time Complexity:
- Writing - O(1)
 - Reading - O(1)
 - Searching - O(1)
 - Deleting - O(1)
 
11. Binary Tree - A parent-child data structure where each parent has exactly 2 or less children.
Time Complexity:
- Writing - O(1)
 - Reading - O(1)
 - Searching - O(N)
 - Deleting - O(N)
 
12. Binary Search Tree - A parent-child data structure where each parent has exactly 2 or less children where the left child is lesser than or equal to the parent and the right child is more than or equal to the parent.
Time Complexity:
- Writing - O(1)
 - Reading - O(1)
 - Searching - O(logN)
 - Deleting - O(logN)
 
13. Graph - A connected data structure where each node can have any number of neighbors.
Time Complexity:
- Writing - O(N)
 - Reading - O(N)
 - Searching - O(N)
 - Deleting - O(N)
 
14. Weighted Graph/Adjacency Matrix - A connected data structure where each node can have any number of neighbors and the distance between two nodes have a cost.
Time Complexity:
- Writing - O(N)
 - Reading - O(N)
 - Searching - O(N)
 - Deleting - O(N)