Professional Documents
Culture Documents
Part-A
Ans1
Procedure: max (start, ptr, mx)
Step1: ptr=start, max=[ptr]info
[initializing pointer with the address of the first node
and mx with the value in the first node]
Step2: ptr=[ptr]link
[increasing the pointer to the next node]
Ans 2
Ans 3
ARRAY
Part-B
(ii) (A+B*D)+(E/F–G)
Ans 5
ANS:- postfix
[AB-]/ [[DEF+*]]
= ( A+ [BD*]) +( E/ [FG-])
= [ABD*+] +(E/[FG-])
= [ABD*+]+ [EFG-/]
= ABD*+EFG-/+
PREFIX
= [ - AB ] [*+ DEF]
= / -AB * + DEF
= [+A*BD ]+ [\E-FG]
= + + A * BD \ E – FG
Ans 6
(i) DEQUES
(ii) PRIORITY
Ans 7
prefix(A,B)
[ end of if structure
[end of if structure]
7. Exit
Ans 8
Now whe F_Ptr = Null, S_Ptr is just trailing behind right! it will
be pointing to the n’th element from the last.