Join Raghavendra Dixit for an in-depth discussion in this video Why study data structures and algorithms?, part of Introduction to Data Structures & Algorithms in Java.
- [Instructor] Let's understand why do we need to learn data structures and algorithms as programmers? When we solve programming problems, we would like to know, at least at a high level, how much time will that algorithm take to solve the problem. Does it take a few milliseconds, a few minutes, or a few days? Because having an estimate of time can help you decide how to break down your problem in relevant pieces or smaller problems. It will also help us decide on hardware requirements for solving a problem.
For example, if you know that executing or running an algorithm on a certain CPU takes, say, over an hour, we can use a more powerful CPU to reduce the time to a few minutes. Or we can think of breaking the problem and distributing it to many smaller CPUs, so they can execute a smaller problem faster and we can get our results in a few minutes. Understanding algorithms also help us know if a particular algorithm is feasible as opposed to it being impossible to do the job.
For example, if you are asked to solve a billion items based on some criteria in say, one second, you would like to know if it is even possible to do it at all. And of course, improvement is a never ending process. We would like to improve our existing algorithms, just like car manufacturers constantly work to raise the bar and want to make faster cars, even though it will seem like, well, what is the need, and that's probably how human interaction grows.
We keep improving. We want to keep improving. Now data structures are studied in context of algorithms. Data structures in computers are ways in which we store data. If we just store the data without doing anything with it, well, it doesn't really mean much, but particular ways of storing the data may help in faster access or faster saving of the data. For example, think about this.
In a library, what will be easier to lead us to a book? If they are kept like they are, in the racks, or if they are put up as huge piles? What if you find your book at the bottom of the pile? Will it be easy to take it out? Or even within the racks, if the books are kept in some order, or they are kept completely randomly, so the way we choose to keep the books, we make it easy finding a book, or easy keeping a book back in its place. In the same way, different types of data structures are used which will make sorting of items faster, or finding an item faster and so on.
So we choose a particular data structure in our program depending on which of the operation is more frequently used, or which operation we would like to be faster than the others.
Note: This course was created by Packt Publishing. We are pleased to host this training in our library.
- Why study data structures and algorithms?
- How to calculate the time complexity
- Using Big O notation
- Using basic sorting and search algorithms
- Searching elements in unordered arrays and ordered arrays
- Implementing a linked list in Java
- Implementing stacks using arrays
- Queues using arrays
- Binary search trees
- Representing heaps using arrays
Skill Level Intermediate
1. Introduction to Algorithms
2. Analysis of Algorithms
3. Basic Sorting and Search Algorithms
4. Linked Lists
5. Stacks and Queues
7. Binary Search Trees
8. More Sorting Algorithms
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.