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.
Author
Released
11/20/2017Note: 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
- Recursion
- Binary search trees
- Representing heaps using arrays
Skill Level Intermediate
Duration
Views
Related Courses
-
Java 7 Essential Training
with David Gassner6h 4m Beginner
-
1. Introduction to Algorithms
-
Introduction1m 8s
-
Euclid's algorithm4m 49s
-
Bubble sort algorithm2m 52s
-
Correctness of an algorithm1m 35s
-
-
2. Analysis of Algorithms
-
Introduction3m 20s
-
The Big O notation3m 26s
-
-
3. Basic Sorting and Search Algorithms
-
Selection sort2m 48s
-
Selection sort: Pseudocode2m 34s
-
Insertion sort: Pseudocode2m 38s
-
Stable vs. unstable sorts3m 46s
-
Sorting any type of object1m 33s
-
-
4. Linked Lists
-
What is a linked list?3m 21s
-
Inserting a new node5m 25s
-
Length of a linked list2m 11s
-
Deleting the head node2m 11s
-
Searching for an item3m 11s
-
Doubly ended lists3m 5s
-
Doubly linked list6m 28s
-
Insertion sort revisited10m 32s
-
-
5. Stacks and Queues
-
Stacks2m 41s
-
Queues2m 32s
-
Queues using arrays5m 29s
-
Double-ended queues1m 58s
-
-
6. Recursion
-
Introduction4m 32s
-
Understanding recursion3m 4s
-
Tail recursion2m 48s
-
Tower of Hanoi8m 24s
-
Merge sort4m 9s
-
Merge sort: Pseudocode4m 24s
-
Merge step: Pseudocode4m 32s
-
-
7. Binary Search Trees
-
The tree data structure3m 41s
-
Binary trees3m 34s
-
Binary search trees2m 1s
-
Deleting an item: Case 16m 5s
-
Deleting an item: Case 22m 58s
-
Deleting an item: Case 33m 44s
-
Tree traversal: In order3m 19s
-
Tree traversal: Pre order1m 58s
-
Height of a binary tree1m 34s
-
-
8. More Sorting Algorithms
-
Introduction1m 27s
-
Quicksort4m 53s
-
Shell sort5m 27s
-
Shell sort example3m 28s
-
Counting sort4m 50s
-
Radix sort2m 27s
-
Bucket sort3m 11s
-
-
9. Heaps
-
Deleting the root1m 53s
-
Inserting an item in a heap1m 59s
-
Heaps as priority queues2m 30s
-
Heap sort2m 30s
-
Building a heap4m 7s
-
Introduction4m 6s
-
-
10. Hashtables
-
Introduction2m 40s
-
Direct access tables2m 4s
-
Hashing1m 37s
-
The hash function6m 16s
-
Conclusion59s
-
- 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.
CancelTake 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.
Share this video
Embed this video
Video: Why study data structures and algorithms?