Professional Documents
Culture Documents
Sunbeam Infotech
• Methods ✓ ③ implementation
• Class & Object
④ interviews
• static members
• Arrays
• Collections
• Inner classes
② Greedy approach
3. Recursion -
③ Dynamic Programming
4. Basic sorting -
5. Linked list -
Evaluations
6. Queues -
CCEE
① Theory - 40 marks -
7. Stacks-
② Lab -
40 marks
8. Trees-
③ Internal - 2d marks
9. Heap /
11. Hashing -
12. Graphs -
• Array
-
② set Me at index
• Linked List
Stack ADT
-
÷ ÷
• Queue ② pop
-
② pop
=
• Heap
• Graph
• Data Structure
✓ • Asymptotic analysis
-
I → canst K
time
-
* *
iterations
•✓ Advanced data structures
• Tree
• Heap • Time complexity
• Graph • Unit time required to complete any algorithm.
• Approximate measure of time required to complete
any algorithm. based
→
some factor
on
.
T&n → not
.
• O(n2)→
Tana → nested loops -
② 3
ifCi==n)
nested loops ③
• O(n3)
-
→ T×n3 →
pf f- prime ) ; "
• O(log n) →
Ta tog partitioning
→
②
n
table
'
"
point of n .
Pf ( num ai ) ;
- -
- -
,
→
return
if found
space
-
Complexity
return I found Input space : Th n
; if not
-
• Time complexity
.
ans
• Worst case → shape iterations → Th n → 0 G) Aux space K
: s =
n its
OCD
• Best case →
min iterations → T=k → b. CD1 0CD
only
mum
I itr ,
* for sorted
array only .
0 1 2 3 4 5 6 7 8
whiles ⇐ r )
{ m= 11 22 33 44 55 66 77 88 99
( der ) 12
ifc Cm)) 9 9
key == a
n→2¥
return INT R L
2 16
'
i
log
2 =
dog n 68
p
→
if (
key salon))
left m
i=ds 2
-1
← past us 2
4 →
•
;
62
= on
Tai
else →
} dog n
im
TX
return l
; ocdosn)
-
→
hmmm
mmmm
hmmmm z
'
= z
^ 20
-
20 = 1
mum
res=fact(4);
mmmm
④ return addr
= - .
int fact(int n) { int fact(int n) { int fact(int n) { int fact(int n) { int fact(int n) {
④ 7
③ 7 ② a
① 7 ⑥
int r; int r; int r; int r; int r;
if(n==0) X if(n==0) X if(n==0)x if(n==0) X if(n==0) ✓
return 1; return 1; ② return 1; ① return 1; return 1;
4 ③ 3 2 r o m
② arguments
mm
^
Created when fn called
③ return address
a
destroyed when fn return
↳ addr of next insta
to be executed when
Fn returns .
ihshru
= addr of next
after fn call .
#
-
int fact(int n) { int fact(int n) { int fact(int n) { int fact(int n) { int fact(int n) { •
/ /
>
/
int r; int r; int r; int r; int r;
if(n==0) if(n==0) if(n==0) if(n==0) if(n==0)
return 1; return 1; return 1; return 1; return 1;
r = n * fact(n-1); r = n * fact(n-1); r = n * fact(n-1); r = n * fact(n-1);←r = n * fact(n-1);
return r; return r; return r; - return r; return r;
} } } } }
f
ff ) :n=Q,t=
•
ret=f C) me
net ,
(2) :n=2it=
f- -ret=f ff 2) ;n=zre+=f
-r=
,
ffz) :n=2it=
C)
f- C)
ff 3) :n=3it=
net
:n=3,t=
-_
f- c) ff 3)
net=f
" z
FC3) : -_nef= g
) :n=3
net -_ t
ff -3 ret=f C)
,
net MC ) -_
res res
res M res
. -
M
-
,
. .
.
M , : M
t&%+
. . .
:
.
. .
; ,
Jvmlos net -_ JVMIOS ; ,
M
ret-s.vn/os net -_ net-s.vn/os :
jvmyog
④
11 22 33 44 55 66 77 88 99
m -_
Cdto ) 12 ;
afm))
✓ key In my M mtl
Rm
return key
ifc actors)
key < L
bin search (d on -1
,
key)
,
" se
bin search ( anti ,
r
, key)c
4
~
÷ ,
• Bubble sort
• Insertion sort
• Quick sort
• Merge sort
• Heap sort
swapfaCD.at;D; f f
>
3 ~
G- G-Dt .tl
-
5
i=
@ + + to 5
3
.
.
D12
non
p j
i=
i= to 4
-
I -72 5
Approbation
-
n of
+ a
2
Theory
n 77 I
i=zpjTz to 5 -
3
Th
riz i=34
'
n - n
to 5 - 2
i=4#
'
Th n order terms
all lower to 5
neglected I
0-45
-
can be .
0 1 2 3 4 5
} I % I § I
a
For Ci=a
;
iss ;i++ ) {
forcjnitl ;ja6;jt {
iffaci ) .
age >
a
G- 3. age )
swapfaCD.at;D;
3