Data Structures and Algorithms, if you are a computer science student or you want to get into this branch you might have heard these terms a lot and it feels like you can’t even survive in this harsh competitive world without knowledge of these and to an extent, this is somewhat true not that you can’t do anything in the world of computer science but if anyone wants to do wonder in this field this is the most basic, first and foremost required to have a solid foundation in data structures and algorithms. Let’s cover every question that may occur in one’s mind one by one.
What are Data Structures and algorithms?
Data Structures as the name suggests are structures used for storage and organizing data that enable efficient access and modification of the respective data. 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.An Algorithm is a finite sequence of well-defined steps i.e it is a collection of well-defined instructions written in human-understandable form, typically to solve a problem or to perform a computation.
It’s all about efficiency….
Yes all these data structures and different algorithms are used to fulfill just one aim which is efficient in terms of time and space, in today’s world space is not even a big enough problem but time is a precious resource and one of the most crucial thing to decide the success of any project any venture in the computer science world and that’s why efficient use of data structures and efficient algorithms are a very much required and it can only be achieved only if you have a strong foundation in DS and algo and that’s why it is called the bread and butter of computer science.
How?
Now, here comes the big question: how to learn DSA?Learning data structures and algorithm is not a static process that includes just cramming all the basic concepts and you are got to go. No, it is a dynamic process that includes constant learning, you can never learn everything about data structures and algorithms and it should be your basic attitude to keep learning and keep asking yourself - can we do better.
You can start with learning basic topics like array, linked list, stack, queue, tree, and graphs. You can learn basic algorithms like searching, sorting, Euclid gcd method, etc. After learning these topics you should start practicing problems on each topic as only then you will be able to understand the need, benefits, and implementation of a particular data structure or algorithm. For practice there are various sources remember the questions which are covered in the university syllabus or covered in the classroom do no good in improving your skills.
You can practice on geeksforgeeks or leetcode but these are placement-specific websites and if you got time you should try to master the concepts instead of solving just questions specific to placement tests. I would advise you to start with competitive programming websites like CodeChef, code forces, SPOJ, and Hackerrank there are editorials available for maximum problems which contain in-depth explanations and solutions of the problem here you can learn and solve those problems which you can’t solve during the contest here real learning happens you will learn new techniques and topics.
Just practice, practice and practice, yes it is the only way after learning basic topics you should just focus on practicing problems, if you get stuck somewhere read the editorial, if you find some new data structure or a new algorithm just read it online and then try to solve the question.
Following the above-stated path, you will learn all the necessary topics eventually and this may take time but perseverance is the key.
Resources To Follow
To study the concepts and other theory parts I personally recommend you to follow free resources as there are plenty and in the end, it is dependent on you and how much effort you yourself put in.For free resources you can follow:
- MyCodeSchool - it is also a good YouTube channel having a good playlist but, here you can’t find much diversity but it is really good to learn basics.
- HackerEarth Codemonk- It is also a great resource having written tutorials source code and problems.
- CodeChef DSA - Codechef conducts an exam on DSA and there in the prepare section you can find a large number of resources topic wise and topics are categorized into three levels.
You can follow Algorithms Specialisation from Stanford University taught by Tim Roughgarden on Coursera it may feel a little bit difficult to understand and theoretical in the beginning but if you can withstand the beginning part it would prove to be a great learning experience.
Books:
- Introduction to Algorithms by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein.
- Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.
- Data Structures And Algorithms Made Easy: Data Structure And Algorithmic Puzzles by Narasimha Karumanchi.
- Data Structures Using C by Reema Thareja.