Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

Complete DSA notes

Rating
-
Sold
-
Pages
1082
Uploaded on
07-06-2023
Written in
2022/2023

These notes cover all the concept

Institution
Course

Content preview

1) If the sequence of operations - push(1), push(2), pop, push(1), push(2), pop,
pop, pop, push(2), pop are performed on a stack, the sequence of popped out
values are ?
A) 2, 2, 1, 1, 2
B) 2, 2, 1, 2, 2
C) 2, 1, 2, 2, 1
D) 2, 1, 2, 2, 2

Explanation: The elements are popped from the top of the stack.

2) Queue can be used to implement ?
A) radix sort
B) quick sort
C) recursion
D) depth first search

3) The postfix equivalent of the prefix * + ab - cd is ?
A) ab + cd - *
B) abcd + - *
C) ab + cd * -
D) ab + - cd *

4) The terms PUSH and POP are related to ?
A) Arrays
B) Stacks
C) Linked List
D) None

5) Minimum number of queues needed to implement the priority queue?

A) four
B) three
C) two
D) one

6) The data structure required to evaluate a postfix expression is
(A) queue
(B) stack
(C) array
(D) linked-list

,7) What data structure would you mostly likely see in a nonrecursive
implementation of a recursive algorithm?
(A) Stack
(B) Linked list
(C) Queue
(D) Trees

8) Let the following circular queue can accommodate maximum six elements with
the
following data
front = 2 rear = 4
queue = _______; L, M, N, ___, ___

What will happen after ADD O operation takes place?
(A) front = 2 rear = 5
queue = ______; L, M, N, O, ___
(B) front = 3 rear = 5
queue = L, M, N, O, ___
(C) front = 3 rear = 4
queue = ______; L, M, N, O, ___
(D) front = 2 rear = 4
queue = L, M, N, O, ___

9) A queue is a,
(A) FIFO (First In First Out) list
. (B) LIFO (Last In First Out) list.
(C) Ordered array.
(D) Linear tree

10) What is the result of the following operation
Top (Push (S, X))
(A) X
(B) null
(C) S
(D) None of these.

,11) Which data structure is used for implementing recursion?
(A) Queue.
(B) Stack.
(C) Arrays.
(D) List.
12) The process of accessing data stored in a serial access memory is similar to
manipulating data on a ------?

a) Heap
b) Binary Tree
c) Array
d) Stack
13) Consider the linked list implementation of a stack. Which of the following
node is considered as Top of the stack?

a) First node
b) Last node
c) Any node
d) Middle node
14) Consider the following operation performed on a stack of size 5.
Push(1);
Pop();
Push(2);
Push(3);
Pop();
Push(4);
Pop();
Pop();
Push(5);

After the completion of all operation, the no of element present on stack are
a) 1
b) 2

, c) 3
d) 4


15) Which of the following is not an inherent application of stack?

a) Reversing a string
b) Evaluation of postfix expression
c) Implementation of recursion
d) Job scheduling
16) Consider the following array implementation of stack:

#define MAX 10
Struct STACK
{
Int arr [MAX];
Int top = -1;
}

If the array index starts with 0, the maximum value of top which does not cause
stack overflow is?

a) 8
b) 9
c) 10
d) 11
17) What is the minimum number of stacks of size n required to implement a
queue of size n?

a) One
b) Two
c) Three
d) Four

Written for

Institution
Course

Document information

Uploaded on
June 7, 2023
Number of pages
1082
Written in
2022/2023
Type
Class notes
Professor(s)
Akshat
Contains
All classes

Subjects

$40.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
akshatgupta4

Get to know the seller

Seller avatar
akshatgupta4 srm university
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
2 year
Number of followers
0
Documents
1
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions