Data Structures and Algorithms
DSA refer to the study of methods for organizing and storing data and the design of procedures (algorithms) for solving problems, which operate on these data structures.
DSA consists of two parts:
- Data Structure
- Alogrithm
Time Complexity
Time Complexity is how much time code take for running.
- Best Case (minimum time) = Ω (1) → Omega
- Average Case = ϴ (n+1/n) → Theta
- Worst Case (maximum time) = O(n) → big
Master Theorem is used for the time complexity.
Space Complexity:
Space complexity in which how much space take the programs in the memory.
- How much variables stored on the memory due to code? For example we write a program if those programs not create another variables then those space complexity is constant b/c they not added more variables.
- Another e.g is Array when we store the same type of data in the Array and array size is increased then also the space in memory is also increased.
Data Structures:
Data Structure is organize, store, manipulate,enabling faster access, insertion, and deletion operations , Common data structures includes;
- Arrays
- Linked List
- Stack
- Queues
- Trees
- Graphs
Each serving specific purposes based on the requirements of the problem at hand.