Garantie de satisfaction à 100% Disponible immédiatement après paiement En ligne et en PDF Tu n'es attaché à rien 4.2 TrustPilot
logo-home
Notes de cours

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

Note
-
Vendu
-
Pages
3
Publié le
06-04-2023
Écrit en
2022/2023

Time Complexity and Big O Notation

Établissement
Cours








Oups ! Impossible de charger votre document. Réessayez ou contactez le support.

Livre connecté

École, étude et sujet

Établissement
Cours

Infos sur le Document

Publié le
6 avril 2023
Nombre de pages
3
Écrit en
2022/2023
Type
Notes de cours
Professeur(s)
Sir amir zia
Contient
Toutes les classes

Sujets

Aperçu du contenu

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,01
Accéder à l'intégralité du document:

Garantie de satisfaction à 100%
Disponible immédiatement après paiement
En ligne et en PDF
Tu n'es attaché à rien

Faites connaissance avec le vendeur
Seller avatar
ziarajput

Faites connaissance avec le vendeur

Seller avatar
ziarajput Punjab group of Colleges
S'abonner Vous devez être connecté afin de suivre les étudiants ou les cours
Vendu
0
Membre depuis
2 année
Nombre de followers
0
Documents
2
Dernière vente
-

0,0

0 revues

5
0
4
0
3
0
2
0
1
0

Récemment consulté par vous

Pourquoi les étudiants choisissent Stuvia

Créé par d'autres étudiants, vérifié par les avis

Une qualité sur laquelle compter : rédigé par des étudiants qui ont réussi et évalué par d'autres qui ont utilisé ce document.

Le document ne convient pas ? Choisis un autre document

Aucun souci ! Tu peux sélectionner directement un autre document qui correspond mieux à ce que tu cherches.

Paye comme tu veux, apprends aussitôt

Aucun abonnement, aucun engagement. Paye selon tes habitudes par carte de crédit et télécharge ton document PDF instantanément.

Student with book image

“Acheté, téléchargé et réussi. C'est aussi simple que ça.”

Alisha Student

Foire aux questions