100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Complete DSA notes $40.49   Add to cart

Class notes

Complete DSA notes

 2 views  0 purchase
  • Course
  • Institution

These notes cover all the concept

Preview 4 out of 1082  pages

  • June 7, 2023
  • 1082
  • 2022/2023
  • Class notes
  • Akshat
  • All classes
avatar-seller
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

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller akshatgupta4. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $40.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

76669 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$40.49
  • (0)
  Add to cart