DSA FINALS

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Dequeue

A data structure in which elements can be inserted or deleted at/from both the ends but not in the middle is?

vertices, paths

A graph is a collection of nodes, called .......... And line segments called arcs or ........... that connect pair of nodes.

Linked list

A linear collection of data elements where the linear node is given by means of pointer is called?

Ancestor node

Any node is the path from the root to the node is called

only one element left in the queue.

In a nonempty queue if front=rear, it means

FILO

Are stacks FIFO or FILO?

(A B D ⋀ + E F - / G +)

Convert the following infix expressions into its equivalent postfix expressions (A + B ⋀D)/(E - F)+G

front = 2 rear = 5 queue = ______; L, M, N, O, ___

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?

Queues use two ends of the structure; stacks use only one.

One difference between a queue and a stack is:

True

Queue can be implemented using a list?

Rear value

The essential condition which is checked before insertion in a linked queue is?

oveflow

The essential condition which is checked before insertion in a linked queue is?

overflow

The essential condition which is checked before insertion in a linked queue is?

C

The five items: A, B, C, D, and E are pushed in a stack, one after other starting from A. The stack is popped four items and each element is inserted in a queue. The two elements are deleted from the queue and pushed back on the stack. Now one item is popped from the stack. The popped item is

AB*CD/+

The postfix form of A*B+C/D is?

LO+ VE*R - FG /**

The postfix form of the expression (L+ O)*(V*E- R)*F / G is?

- +pq * rt

The prefix form of an infix expression p + q - r * t is?

The right subtree can be empty

The property of binary tree is

350

The result of evaluating the postfix expression 5, 4, 6, +, *, 4, 9, 3, /, +, * is?

deQueue()

Which is the correct operation for: "Remove the front item from the queue and return it"

A) finding factorial B) tower of Hanoi C) infix to postfix conversion D) all of the above

Which of the following is an application of stack?

A) Stacks B) List C) Strings D) Trees

Which of the following is non-liner data structure?

A) Insertion Sort B) Bubble Sort C) Merge Sort D) Heap Sort

Which of the following is not the internal sort?

Memory Allocation

is an operation wherein a specified amount of memory space is reserved for storage of data.

Traversal

is not the operation that can be performed on queue.

rear

In linked list implementation of a queue, where does a new element be inserted?

Depth First

In the ................. traversal we process all of a vertex's descendants before we move to an adjacent vertex

Inserting a node at the end of the list

What is the functionality of the following code? public void function(Node node) { if(size == 0) head = node; else { Node temp,cur; for(cur = head; (temp = cur.getNext())!=null; cur = temp); cur.setNext(node); } size++; }

Find and return the position of the given element in the list.

What is the functionality of the following piece of code? public int function(int data) { Node temp = head; int var = 0; while(temp != null) { if(temp.getData() == data) { return var; } var = var+1; temp = temp.getNext(); } return Integer.MIN_VALUE; }

reuse empty spaces

What is the reason for using a "circular queue" instead of a regular one?

X

What is the result of the following operationTop (Push (S, X))

overflow

What is the term for inserting into a full queue known as?

Pointers

- A special pointer is a special variable, it isspecial because it can only contain as its value amemory address. - A pointer provides an indirect way to access thevalue stored in the memory where it points. - A variable that holds a memory address ofanother object

c, d, W, X, Y

A queue of characters currently contained a,b,c,d. What would be the contents of queue after the following operation DELETE, ADD W, ADD X, DELETE, ADD Y.

9

Consider the following array implementation of stack:#define MAX 10Struct 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?

5

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

Stack operations are performed smoothly

Consider the following operations performed on a stack of size 5 : Push (a); Pop() ; Push(b); Push(c); Pop(); Push(d); Pop(); Pop(); Push (e) Which of the following statements is correct?

First node

Consider the linked list implementation of a stack. Which of the following node is considered as Top of the stack?

xyz*+pq*r+s*+

Convert the following Infix expression to Postfix form using a stack x + y * z + (p * q + r) * s, Follow usual precedence rule and assume that the expression is legal.

front

In linked list implementation of a queue, from where is the item deleted?

front = null , rear = null.

In linked list implementation of a queue, the important condition for a queue to be empty is?

empty

If front=rear ,then the queue is?

ABCD

If the elements "A", "B", "C" and "D" are placed in a queue and are deleted one at a time, in what order will they be removed

d,c,b,a

If the elements "D, "C", "B" and "A" are placed in a queue and are deleted one at a time, in what order will they be removed?

5

If the numbers 5, 10, 3, 42 are enqueued onto a queue in that order, what does dequeue return?

Linear search

In ..............., search start at the beginning of the list and check every element in the list.

5

In a circular queue of size 7 if front index=5 and rear index =3 then ___ dequeue operations has been performed.

(rear+1) % Number of Item

In a circular queue, how do you increment the rear end of the queue?

front is NULL

In linked list implementation of a queue, the important condition for a queue to be empty is?

Linked Lists

The advantage of ................. is that they solve the problem if sequential storage representation. But disadvantage in that is they are sequential lists.

postfix expression

The type of expression in which operator succeeds its operands is?

stack

What data structure can be used to check if a syntax has balanced parenthesis ?

Front, Rear

What is examples of variable being used to certain algorithm to implement Queue in Array ?


Ensembles d'études connexes

Chapter 5 GDP (Gross Domestic Production) Quiz

View Set

Final Exam Part 2 (Chapters 8 - 14)

View Set

Advanced Health Assessment Test 1

View Set

Biology exam 2 Module HW/ Pre-assessment

View Set

Implement & Support Servers chap 1-7 & Mid-Term,

View Set

Factoring Trinomials: a = 1 Quiz

View Set

Health Assessment Exam 3 test bank, Chapter 21: Abdomen (Health Assessment), Ch. 18PAD and PVD,

View Set

Liability, derivative suits, piercing the corporate veil

View Set

Fundamentals of Microeconomics, Level A

View Set