Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Algorithm Complexity Summary — Big-O, Sorting, Recurrence Relations, Trees

Rating
-
Sold
-
Pages
36
Uploaded on
27-04-2026
Written in
2024/2025

A clear and exam-focused summary of algorithm complexity and data structures, covering Big-O analysis, sorting algorithms, recurrence relations, binary search trees, AVL trees, and red-black trees. A useful revision sheet for algorithms and data structures courses.

Show more Read less
Institution
Course

Content preview

, Lesson 1

Warst case
complexity : T(n) = mai
[t() x-In] :




Best
complexity
case : T(n) = min Gt(x) : -In]
Average case
complexity T(n) =
[ p(x)t(x)
xtIn

p(x) =
probability of having as input
If all instance have the same
probability and In is finite :


1
T(n) [xtInt(x)
p(x) = and =



lIn) /In/

total time 2 + 2ck
2 if the element is inthe sequence

Element not found : T(x) =
2n + 2

length of the sequence

n =




Element found at last position :




T(x) =
2 + 2cn + 2 = 4+ 2

Wast case : 22h + 4



Best case (elemt first position) : T(n) =
4c + 2c = 6



Average : T(n) =
14 + 2k) = (2 k) +
= (2) = (2nn
= cn + 5n

Growth
Order
of
Big -O rotation

O(f(n)) =

(g(n) : 7 no ,o such that
g(n) < (f(n) for n, no]

Big-1 rotation (f(n) =

(g(n) : -no , o such that
g(n) (f(n) for
,
nc, no]

Big-O rotation O(f(n)) =
[g(n) g(n) 0(f(n)
: = and
g(n) =
r(t(n))]
·
n =
0(n(2) g(n) =
nf(n) = 4/2
g(n) = c .

f(n)c =
2 no 1 =



·
100n2 + n =0(n') g(n) = 100n2+ n f(n) = n

< c f(n) en
g(n) .
= 100m2 + n c= 101 no =
1
zn + 2 0(n3) +r 2
f(n) 3
·

=
g(n) = + =




f(n) 7n3 n2 c
g(n) = c .
= + = c= 8 no = 1



N100 e(n)
g(n) 4,00 f(n) c 1/100
= =
f(n) = n
g(nic , c .
=
no = 1

,If f = O (F(n)) and
g = 0(f(n)) then :




f g + =
0(maxF(n) G(n) ,




O (F(n)) + =(f(n)) = 0(max F(n) , G(n)
>
- Also
apply for 2 0 0




Complexity vs Time

T(n) 1 min for 1000
= n
inputs
T(n) =
log n - 0, 65

T(n) =
nlogn 310 min

T(n) = n2 = 16h

T(n) = n3 -
694 days
T(n) = 2" -infinite


Order
of Growth slowest -
fastest
n ch
1 ,
logn logn , ,
En ,
n
,
nogn , ,




Equations
n+
f(n) n + 0(1)
g(n) 0(1) f(n) g(n)
·
= = =
= +

, TD1
1 Cret 2 Efficient
*
Alg . .




anank Ck
order : constant <
log <linear <
nlog(n) <




O ⑦
Big Big
1 Wast Best Average
r(g(n)
.




2
. Upper lower & Tight >
- O(g(n)
3 . 0x f(n) => c .

g(n) f(n)c ,
c .


g(n) Cg(n) = f(n) = Gf(n)
f(n) =
0(g(n)
.im
4 = 0
lim
n- p
=
clim- = (s)


constant 1 statement

logarithmic logn divide in
half
linear N loop
livarithmic Nlogn divide and conquer

quadratic N2 double loop
cubic N3 tiple loop
2N
exponential exhalutive search



f(n) Fn no
Big-0 :
g(n)
= c .
,




Big-1 :
f(nk g(n) Enc no
,
c .
,




Big-0 :
(g(n)[f(n) = g(n) Enc , no




logi slogan nan'logn <n22" in !

Written for

Institution
Course

Document information

Uploaded on
April 27, 2026
Number of pages
36
Written in
2024/2025
Type
SUMMARY

Subjects

$9.54
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
eugniedelaunay

Get to know the seller

Seller avatar
eugniedelaunay Computer Science
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
3 weeks
Number of followers
0
Documents
11
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

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions