Join Raghavendra Dixit for an in-depth discussion in this video How to calculate the time complexity, part of Introduction to Data Structures & Algorithms in Java.
- [Instructor] So the first step is to talk about…the running time of an algorithm…in terms of the size of the input data,…but even this doesn't quite work…because the same algorithm…running on the same machine…over the same set of input data…will not really take exactly the same time…in two different runs.…Now one thing to note here…is that an algorithm working over a small number of elements…will take less time…than when it works over a larger number of elements.…
That is, say, if an algorithm takes, say,…one millisecond to work with five data items,…it may take about two milliseconds,…or four milliseconds,…to work with 11 data items.…So when we study time complexity of an algorithm,…we essentially want to understand, or know,…how the time of an algorithm varies…with the size of the input data.…That is, we would like to know…what is called as the order of growth of an algorithm…with the size of input data.…
Now what does it mean?…Let's say there are two algorithms to do something useful,…say, sorting data,…and both algorithms take 10 milliseconds…
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.