Data Structure Interview Question and Answers
11. |
Define sink node? |
|
A node whose out degree is 0 acts primarily as a depository of information and hence is called a sink node. |
|
|
12. |
Define stack with its operations? |
|
- A Stack is a data structure where the insertion and deletion can be performed in Last in First out (LIFO) fashion at the end of the stack called Top.
-
Operations of Stack
- Push – To insert an element in to the stack. Top is incremented.
- Pop – To delete an element from the stack. Top is decremented.
|
`
|
|
13. |
Define Minimum Spanning Tree? |
|
A minimum Spanning Tree of an undirected graph G is a tree formed from graph edges that connects all the vertices of G at lowest total cost. |
|
|
14. |
Define Queue? |
|
Queue is a data structure which works in First In First out (FIFO) basis where insertion is performed at one end called Rear and deletion is performed at one end called front.
|
|
|
15. |
List the operations of Queue? |
|
- Enqueue –Inserts an element in to the queue. Rear pointer is incremented Front pointer in constant.
- Dequeue – Delete the element from queue. Front Pointer incremented. Rear pointer is constant.
|
|
|