The programmer must be having a question that why should I study DSA if it has no use in real life? Why do Tech companies ask questions related to this?
Data structure and algorithms are the basics of computer science, which is the requirement to optimize the application and building a scalable application.
A lot of programmers including beginners/experienced hesitate to learn it because they think it’s of no use in real life.
To solve any problem we have to go through the below steps:
a) Taking input
b) Processing with business logic
c) providing the result
We need an efficient data structure to capture input/output and an appropriate algorithm to process the data with given business logic.
We will go through one real-time situation: If we need to search the order number in 500 pages of a word document assume order numbers are sorted in increasing order. Let’s think on the approach:
We might think on the very first approach that comes in mind is we try to search it in a sequential manner. But it will take a lot of time(Brute force approach).
The second approach we can think off go to page no 100 and if my order number is listed over there we got the solution, but if the order number is not available on that page but others order number is greater than we can go on the previous page and do repeat the same process recursively.
The below main reason for learning DSA:
- If you want to crack the interviews and get into the FANG(Facebook/Amazon/Netflix/Google)
- If you want to solve real-life complex problems.
Please find below DS and Algorithms, the developer should be having hand-on:
Data Structure :
- Binary Trees
- Heaps Graphs
- Sorting, Searching and Binary search
- Dynamic programming and memorization
- Greedy Algorithms
- Graph traversal, breadth- and depth-first
Please correct me if anything is wrong.