0% found this document useful (0 votes)
14 views2 pages

Assignment No 2 DS July24

Dsgt assignment 2 module 2 assignment

Uploaded by

swatimulik83
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views2 pages

Assignment No 2 DS July24

Dsgt assignment 2 module 2 assignment

Uploaded by

swatimulik83
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Mahatma Gandhi Mission’s College of Engineering and Technology

Kamothe, Navi Mumbai


Assignment -II
Subject-DS Div-A and B Sem-III Class –SE
Date of Issue:07-08-2024 Date of Submission: 24-08-2024
Q. N Question

Q1. select correct answer


1) Process of inserting an element in stack is called ____________
a) Create b) Push
c) Evaluation d) Pop
2) Entries in a stack are “ordered”. What is the meaning of this statement?
a) A collection of stacks is sortable
b) Stack entries may be compared with the ‘<‘ operation
c) The entries are stored in a linked list
d) There is a Sequential entry that is one by one
3) Which of the following is not the application of stack?
a) A parentheses balancing program
b) Tracking of local variables at run time
c) Compiler Syntax Analyzer
d) Data Transfer between two asynchronous process
4) What is the value of the postfix expression 6 3 2 4 + – * ?
a) 1 b) 40
c) 74 d) -18
5) Here is an infix expression: 4 + 3*(6*3-12). Suppose that we are using the usual stack algorithm to
convert the expression from infix to postfix notation. The maximum number of symbols that will
appear on the stack AT ONE TIME during the conversion of this expression?
a) 1 b) 2
c) 3 d) 4
Q2. Choose Correct Options
1) In a circular queue, how do you increment the rear end of the queue?
a) rear++ b) (rear+1) % Size
c) (rear % Size )+1 d) rear–

2) With what data structure can a priority queue be implemented?


a) Array b) List
c) Heap d) Tree
3) What is a dequeue?
a) A queue with insert/delete defined for both front and rear ends of the queue
b) A queue implemented with a doubly linked list
c) A queue implemented with both singly and doubly linked lists
d) A queue with insert/delete defined for front side of the queue
4) Which of the following properties is associated with a queue?
a) First In Last Out b) First In First Out
c) Last In First Out d) Last In Last Out
5) What is the need for a circular queue?
a) effective usage of memory
b) easier computations
c) to delete elements based on priority
d) implement LIFO principle in queues
6) The postfix form of the expression (A+ B)*(C*D- E)*F / G is?
a) AB+ CD*E – FG /** b) AB + CD* E – F **G /
c) AB + CD* E – *F *G / d) AB + CDE * – * F *G /
7) The postfix form of A*B+C/D is?
a) *AB/CD+ b) AB*CD/+
c) A*BC+/D d) ABCD+/*
8) Which data structure is used for implementing recursion?
a) Queue b) Stack
c) Array d) List
9) Circular Queue is also known as ________
a) Ring Buffer b) Square Buffer
c) Rectangle Buffer d) Curve Buffer
10) A normal queue, if implemented using an array of size MAX_SIZE, gets full when?
a) Rear = MAX_SIZE – 1 b) Front = (rear + 1)mod MAX_SIZE
c) Front = rear + 1 d) Rear = front
Q3. Answer the following questions in brief
1 Write a program in ‘C’ to check for balanced parenthesis in an expression using stack.
2 What is recursion? Explain use of stack for recursion
3 Explain priority queue. Write ADT for priority queue and state its applications
Explain linear queue and circular queue with suitable example. Give the advantages of circular queue
4
over linear queue.
5 Write a ‘C’ program to implement Double Ended Queue (DQUEUE)
6 Evaluate the postfix expression "2 3 ^ 5 4 * + 7 -".
7 Evaluate the postfix expression "3 4 5 * 6 + - 7 2 / 3 * + 9 - 2 ^".
8 Convert the infix expression ((A + B) * (C - D) / E) ^ (F + G * H) - I to postfix notation.

You might also like