Join Raghavendra Dixit for an in-depth discussion in this video Searching elements in an unordered array, part of Introduction to Data Structures & Algorithms in Java.
- [Instructor] After learning about these basic…sorting algorithms, let's see how can we…search for an item in an array.…And let's understand the worst case time complexity…of searching for an item in an array.…Let's start with an unordered array,…which is basically the one in which the elements…of the array are unsorted.…They can be in any random order.…Now, accessing an array element…through its index is very fast, alright?…Because when we reference an array…we basically have the address of the first element.…
And going to any other element is very fast.…Just by adding the index number as an offset…to the first element's address, we get the new address…and the element can be accessed through that.…So accessing array elements like this…does not really depend on the size of the array.…And we say that accessing array elements…through their index is a constant time operation.…Which we write as O one, alright?…But what if we want to search…for an element without knowing its index?…For example, what if we want to find the number eight?…
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.