# How to Prepare for Data Structure Viva? Top 8 Questions Answered By Experts

by Assignment Desk Education Consultant

Have you completed your data structure assignment?

KUDOS!

But, wait! Are you prepared for the viva questions?

If not, here are the top 8 questions that are answered by the academic writers who provide data structure assignment help online to students.

Take a look at the answers of each of these questions and get ready to face the viva.

Q.1. Name different operations that can be performed on various data structures?

Ans. There are five different operations that can be applied on various data structures. This includes:

Ø Insertion,

Ø Deletion,

Ø Sorting,

Ø Traversal, and

Ø Searching.

Q.2. What are the 5 major applications of Stack?

Ans. Stack is a linear data structure. It makes use of either FIFO (First In First Out) or LIFO (Last In First Out) to access elements. Five of its major applications are:

Ø Reverse a string using a stack,

Ø Implement two stacks in an array,

Ø Evaluate postfix expression,

Ø Check for balanced parentheses in an expression, and

Ø Convert infix into postfix using stack.

Q.3. Explain Infix, Postfix, and Prefix notations. Give an example.

Ans. Infix, Postfix and Prefix are the three different notations in data structuring.

Ø Infix: It is the most usual way to write expressions. The notation is:

X+Y- With operators written in between of their operands.

Example: P * Q ( R + S )/T

Ø Postfix: It is also known as reverse polish, notation:

XY+ Operators are written after their operands

Example: P Q R S + * D /

Ø Prefix : It is also referred as polish, notation:

+XY Operators are written before their operands.

Example:/ * P + Q R S T

Q.4. How to check if a Binary Tree is BST?

Ans. If the inorder traversal of a binary tree is sorted, it is a BST. Therefore, the key of identification is conducting an inorder traversal and keeping an eye on the previous key value. If the current key value is greater than the previous one, continue the process or else return false.

Q.5. How can stack be used to implement queue?

Ans. There are two stack methods through which a queue can be implemented:

Ø By making enQueue operation costly or

Ø Through making deQueue operation costly.

Q.6. Describe two types of linked lists.

Ans. A linear data structure is like arrays where each element that is a node of a list is a separate object. Each node in turn comprises of two items i.e., the data and the reference to the next node. There are three types of linked lists- singly linked list, doubly linked list, and circular linked list.

Ø Singly Linked List: In this, each node carries data and a reference of a next node. Apart from the last node, as it either carries  a next address or a NULL reference.

Example 1-->2-->3-->4-->NULL

Ø Doubly Linked List: This list includes two reference linked with each nodes. One of these references is for the previous node and one is for the preceding one.

Example: NULL<->1<->2<->3<->NULL

Q.7. Explain linear and non-linear data structures.

Ans. The two types of data structures are:

Ø Linear: If the elements of data structures form a sequence or a linear list, it is called linear.

Ø Non-Linear: If traversal of nodes is nonlinear in nature then the data structure is classified as non-linear.

Example: graphs and trees.

Q.8. Differentiate an array from a linked list.