Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Page 9
Join Telegram:- @engineeringnotes_mu
/ or= / /
=
e APPLtcnTiolS 8-- OF STACK
_ 4 ) ell um-nes poe
mtheu
Och2gpuwthe?
l,
an epY2uo
well m - n e&5
pa+en the.Zs =
Lg Uell -fm
g ed o no
E
.
'
/- t ha t ce ·matchana, pent.Z •
p
2 ell [pones
•
II
e], pon th
esis .
-
J I
ha. u-
I
1
c ( ) 2 malcknq
.
I '
)
I
« ) X ± matchnq
I ,
e-
I I
- fosv an ex 28509 lo be tel fo-red Q clos?
•
•
-
N eu ? lae n eds zd oops, nested doop,
condile lops to den o te blo c e, co de . R he _-
paius { } to mot na tc h , e f l t (aad to en envoy
J, •
PIL -lfh'!JZ. '-'-'------------------
I=====>============��===========·"
Page 14
I '
Join Telegram:- @engineeringnotes_mu
' Gt ---�-----!
'
.
•
To cohvet 'x to Pos x nesen a Slack
o o ld be Ued. tn th& co n veusl e n the g#auk @pad
be used as a medalor betweun S o u¢ s 4; - T
and «get st6rg (pest}y?). slack ft qpzutor
fir semne {ire.
f
s scanned
. I
lo 8 •
'
[_ the Scarnud
OY alphabet, ZE
4 : U S ca n nd c h a@ cl ( c hy y _E
acn th e ' ' {l % had to slack.
op ~ n?
f---------=
s :
'
• ( h
I... . , .
en
r, O
'•••
Ls
O
on
JP
o x
>
u&
• • -
H1,
p
.J
tu Z¢ ult le bus hed o the slack th ch.
6 : L the Scanned chauactuu (ch, a a clos?
' ) ' then l t the
7
I
---
•
Page15
Join Telegram:- @engineeringnotes_mu
<
TheP
apaaote?
e
a«
ppedd
e-
· --i. wttfx s+>f1J_· _
•
:
- --(-c-------1
C
, ,
• {
A
l
•
kl
------,-----+ ---t-_U
, �+ -+_A _
----.;;--:_____c,
B c'_ -+-
· _
l ��C�+�----+---A_B .
! ,(]A+
]d r A p t
]((k(Bh
c l i s ( A B + C
-
- sk - A D -t C
�----+--------
•
h? Ccy
8+CD
l] ( k AG+CD
I
] A B + C D - k
----,--�-----t----------------
l] AB +CD
I '
I E / AB + C D - a E
o£
end st8ng + A8
+CD-E/
l d [
Join
5.A non leaf node with n-1 keys must have n number Telegram:- @engineeringnotes_mu
of children.
6.All the key values within a node must be in Ascending Order.
->example:
20
23,35,44
7,14
1,5 18,19
21 36,40 50
II.B+ Tree
->A B+ tree is a data structure often used in the implementation of database indexes.
->Each node of the tree contains an ordered list of keys and pointers to lower level
nodes in the tree. These pointers can be thought of as being between each of the keys.
->Properties:
1. The root node points to at least two nodes.
2. All non-root nodes are at least half full.
3. For a tree of order m, all internal nodes have m-1 keys and m pointers.
4. A B+-Tree grows upwards.
5. A B+-Tree is balanced.
6. Sibling pointers allow sequential searching.
->example:
20, 70
1,2,8,19 25,30,50,55 75,85,90,100
Q1. c) Write a program to implement Binary Search on sorted set of integers. (10)
Solution:
Join Telegram:- @engineeringnotes_mu
Step 5: As L is simgle it becomes child node of J
Original Tree
c) What is hashing? What properties should a good hash function
demonstrate? (05)
Hashing:
- Hashing is a technique by which updating or retrieving any entry can be
achieved in constant time O(1).
- In mathematics, a map is a relationship between two sets. A map M is a
set of pairs, where each pair is in the form of (key, value). For a given key,
its corresponding value can be found with the help of a function that maps
keys to values. This function is known as the hash function.
- So, given a key k and a hash function h, we can compute the
value/location of the value v by the formula v = h(k).
- Usually the hash function is a division modulo operation, such as h(k)=k
mod size, where size is the size of the data structure that holds the values.
- Hashing is a way with the requirement of keeping data sorted.
- In best case time complexity is of constant order O(1) in worst case O(n)