Join Raghavendra Dixit for an in-depth discussion in this video Searching elements in an ordered array, part of Introduction to Data Structures & Algorithms in Java.
- [Instructor] Let's see how to find an element in case of…an ordered array now.…Ordered arrays are those in which all the elements…are sorted either in ascending or descending order.…So, let's assume for our example that all the items…are sorted in ascending order.…In the last part, we saw how to find items…when the data is completely random.…Now that we know that items are ordered,…can we do better than order of n time…because now we have some more information about the data?…Imagine that you have to go to a library,…and you have to find a book by its title on a…really long bookshelf.…
If the books were kept in a completely random order,…you will have to start from one end and keep going linearly…one book at a time until you find the book,…or say the book is not kept on that shelf.…But if you know that the books are kept according to…the alphabetical order of their titles,…can you search for the book faster?…Pause the video here and think about…how can you find the book faster?…Let's say that we have this bookshelf…
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?
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.