# Data Structure Interview Questions

## What is the difference between NULL and VOID?

Post Views: 48,356 Null is actually a value, whereas Void is a data type identifier. A null variable simply indicates an empty value, whereas void is used to identify pointers as having no initial size.

## What are the advantages of Binary search over linear search?

Post Views: 48,278 There are relatively less number of comparisons in binary search than that in linear search. In average case, linear search takes O(n) time to search a list of n elements while Binary search takes O(log n) time to search a list of n elements.

## What are the applications of Graph data structure?

Post Views: 48,258 The graph has the following applications: Graphs are used in circuit networks where points of connection are drawn as vertices and component wires become the edges of the graph. Graphs are used in transport networks where stations are drawn as vertices and routes become the edges of the graph. Graphs are used in maps that draw cities/states/regions as vertices and adjacency relations as edges. Graphs are used in program flow analysis where procedures or modules are treated…

## Mention the data structures which are used in graph implementation.

Post Views: 48,245 For the graph implementation, following data structures are used. In sequential representation, Adjacency matrix is used. In Linked representation, Adjacency list is used.

## Differentiate among cycle, path, and circuit?

Post Views: 48,235 Path: A Path is the sequence of adjacent vertices connected by the edges with no restrictions. Cycle: A Cycle can be defined as the closed path where the initial vertex is identical to the end vertex. Any vertex in the path can not be visited twice Circuit: A Circuit can be defined as the closed path where the intial vertex is identical to the end vertex. Any vertex may be repeated.

## Define the graph data structure?

Post Views: 48,236 A graph G can be defined as an ordered set G(V, E) where V(G) represents the set of vertices and E(G) represents the set of edges which are used to connect these vertices. A graph can be seen as a cyclic tree, where the vertices (Nodes) maintain any complex relationship among them instead of having parent-child relations.

## List some applications of Tree-data structure?

Post Views: 48,242 Applications of Tree- data structure: The manipulation of Arithmetic expression, Symbol Table construction, Syntax analysis Hierarchal data model