Important Instructions To Examiners:: Correct 2M
Important Instructions To Examiners:: Correct 2M
Important Instructions To Examiners:: Correct 2M
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 1 / 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Example:-
Algorithm A: - a=a+1
Algorithm B: - for x = 1 to n step 1 a=a+1 Loop
Page 2 / 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Example:-
Example
1M
Page 3 / 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 4 / 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 5 / 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Ans. Information: It is also known as data part. It is used to store data Explanatio
inside the node. n of each
term 1M
Next Pointer for Linked list: Which Hold the Address of the next
node, which intern links the nodes together.
Page 6 / 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 7 / 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 8 / 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 10 / 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 11 / 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Stack:
It is a collection of elements stored in a sequence. It has one end called
as stack top. All elements are inserted and deleted only from stack top
so stack is also called as LIFO-Last. In First Out data structure. Last
inserted element in stack is removed first from stack.
Example: Stack of five elements:
Queue:
It is a collection of elements stored in a sequence. It has two end: one
is rear end from which an element is inserted in a queue and other is
front from which an element is removed from queue so queue is also
called as FIFO-First. In First Out data structure. First inserted element
in a queue is removed from queue first.
Page 12 / 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 13 / 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Ans.
Correct
conversion
4M
Page 14 / 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 15 / 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
}
case 3:
{
display();
break;
}
case 4: {
printf("Exit\n");
break;
}
default: printf("Enter Valid choice from 1/2/3/4\n");
break;
}
}while(choice !=4);
return 0;
}
void insertq(int x)
{
//check queue is full?yes or no
if(rear == qsize-1)
printf("Queue is Overflow\n");
else
{
//queue with zero element
if(front ==-1 && rear==-1)
{
front=0;
rear =0;
}
else
{
// queue with one or more element
rear = rear +1;
}
Page 16 / 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 17 / 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
}
else
{
printf("Queue elements are\n");
for(i=front; i<=rear; i++)
{
printf("%d\t",queue[i]);
}
}
}
e) Compare linear list with Circular list (Any four points) 4M
Ans. Any four
Sr No Linear List Circular List correct
points 1M
each
1. Next field of the last Next field of the last node is
node is set to NULL. connected back to head node.
2. Points to first node. Points to last node.
3. Insertion at end has O(n) Insertion at end has O(1)
complexity. complexity.
4. Ends on Finding the Searching terminates on
NULL pointer. coming to first node.
5. Not suited for Can be used for Queue data
implementing data structure.
structure.
Page 18 / 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Ans.
Infix Expression Read Stack Postfix
Correct
Charac Contents Expressions
evaluation
ter
6M
((a / (b – c + d)) *( e – a) *c) ( (
(a / (b – c + d)) *( e – a) *c) ( ((
a / (b – c + d)) *( e – a) *c) a (( a
/ (b – c + d)) *( e – a) *c) / ((/ a
(b – c + d)) *( e – a) *c) ( ((/( a
b – c + d)) *( e – a) *c) b ((/( ab
– c + d)) *( e – a) *c) - ((/(- ab
c + d)) *( e – a) *c) c ((/(- abc
+ d)) *( e – a) *c) + ((/(+ abc-
d)) *( e – a) *c) d ((/(+ abc-d
)) *( e – a) *c) ) ((/ abc-d+
) *( e – a) *c) ) ( abc-d+/
*( e – a) *c) * (* abc-d+/
( e – a) *c) ( (*( abc-d+/
e – a) *c) e (*( abc-d+/e
– a) *c) - (*(- abc-d+/ea-
a) *c) a (*(- abc-d+/ea-
) *c) ) (* abc-d+/ea-
*c) * (* abc-d+/ea-*
c) c (* abc-d+/ea-*c
) ) Empty abc-d+/ea-*c*
stack
Page 19 / 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Creating
singly link
list 2M
Page 20 / 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
i) Degree of tree
ii) Degree of node 3
iii) Level of node 5
iv) In-degree of node 3
v) Out-degree of node 3
Each
vi) Height of tree correct
answer 1M
Ans. i) 2
ii) 2
iii) Level 2
iv) 1
v) 2
vi) 3
6. Attempt any TWO of the following: 12
a) With a neat sketch explain working of priority queue. 6M
Ans. Priority queue: Correct
A priority queue is a data structure in which each element is explanatio
n 6M
assigned a priority.
The priority of the element will be used to determine the order in
which the elements will be processed.
The general rules of processing the elements of a priority queue are:
An element with higher priority is processed before an element
with a lower priority.
Two elements with the same priority are processed on a first-come-
first-served (FCFS) basis.
A priority queue can be thought of as a modified queue in which
when an element has to be removed from the queue, the one with
the highest-priority is retrieved first.
Page 21 / 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Correct
tree
diagram
6M
Page 22 / 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Adjacency
List 3M
Page 23 / 23