100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Class notes

Class notes CS102 Data Structures and Algorithms in C++, ISBN: 9780470383278

Rating
-
Sold
-
Pages
3
Uploaded on
06-04-2023
Written in
2022/2023

Time Complexity and Big O Notation

Institution
Course








Whoops! We can’t load your doc right now. Try again or contact support.

Connected book

Written for

Institution
Course

Document information

Uploaded on
April 6, 2023
Number of pages
3
Written in
2022/2023
Type
Class notes
Professor(s)
Sir amir zia
Contains
All classes

Subjects

Content preview

Time Complexity and Big O
Notation
An analogy to a real-life issue:

 This morning I wanted to eat some pizza; So, I asked my brother to get
me some from Dominos, which is 3 km away.
 He got me the pizza, and I was happy only to realize it was too little for
29 friends who came to my house for a surprise visit!
 My brother can get 2 pizzas for me on his bike, but pizza for 29 friends is
too huge of an input for him, which he cannot handle.




What is Time Complexity?
Time Complexity is the study of the efficiency of algorithms. It tells us how much
time is taken by an algorithm to process a given input. Let's understand this
concept with the help of an example:
Consider two developers Shubham and Rohan, who created an algorithm to sort
‘n’ numbers independently. When I made the program run for some input size n,
the following results were recorded:
Time Taken By Shubham’s
No. of elements (n) Time Taken By Rohan’
Algo
10 elements 90 ms 122 ms
70 elements 110 ms 124 ms
110 elements 180 ms 131 ms
1000 elements 2s 800 ms
We can see that at first, Shubham's algorithm worked well with smaller inputs;
however, as we increase the number of elements, Rohan's algorithm performs
much better.
Quick Quiz: Who’s algorithm is better?
$7.99
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
ziarajput

Get to know the seller

Seller avatar
ziarajput Punjab group of Colleges
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
2 year
Number of followers
0
Documents
2
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions