Join Raghavendra Dixit for an in-depth discussion in this video Comparison of running times, part of Introduction to Data Structures & Algorithms in Java.
- [Instructor] Let's see what the notation means…and how it is used for getting a sense of…how fast an algorithm is.…Suppose we have an array elements, say of size six,…if you want to access the element at index four,…it will take some time.…Let's say it takes 10 milliseconds.…By the way, array elements are accessed by using index…as an offset from the first element.…So it's really fast.…So now, if we have an array of hundred elements,…and we want to access the 99th element,…how much time does it take?…Well, it will still take about 10 milliseconds.…
So here, accessing the array element using an index…does not depend on the size of the input.…So we say that accessing array elements…through their indices is a constant time operation,…which we represent as big O of one.…Then let's take another example.…We have an unordered array.…That is, all the elements of an array…are in random order, neither ascending nor descending.…
If we were to search an element,…what is the worst case situation?…Well, if the data in the array is random,…
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.