Interview Questions Flashcards
What is Data Structure?
The data structure is a way that specifies how to organize and manipulate the data. It also defines the relationship between them.
Data Structures are the central part of many compute algorithms as they enable data to be handled in an efficient way.
Describe the types of Data Structures?
Data Structures are mainly classified into two types:
Linear Data Structure: A data structure is called linear if all of its elements are arranged in the sequential order. In linear data structures, the elements are stored in a non-hierarchical way where each item has the successors and predecessors except the first and last element.
Non-Linear Data Structure: The Non-linear data structure does not form a sequence i.e. each item or element is connected with two or more other items in a non-linear arrangement. The data elements are not arranged in the sequential structure.
What are the areas of applications for data structures?
Compiler Design,
Operating System,
Database Management System,
Statistical analysis package,
Numerical Analysis,
Graphics,
Artificial Intelligence,
Simulation
What is the difference between file structure and storage structure?
The main difference between file structure and storage structure is based on memory area that is being accessed.
Storage structure: It is the representation of the data structure in the computer memory.
File structure: It is the representation of the storage structure in the auxiliary memory.
Which data structure is used to perform recursion?
Stack data structure is used in recursion due to its last in first out nature.
Operating system maintains the stack in order to save the iteration variables at each function call
What is a postfix expression?
An expression in which operators follow the operands is known as postfix expression. The main benefit of this form is that there is no need to group sub-expressions in parentheses or to consider operator precedence.
The expression “a + b” will be represented as “ab+” in postfix notation.
Write the postfix form of the expression: (A + B) * (C - D)
AB+CD-*
Which data structures are used in BFS and DFS algorithm?
In BFS algorithm, Queue data structure is used.
In DFS algorithm, Stack data structure is used.
In what scenario, Binary Search can be used?
Binary Search algorithm is used to search an already sorted list. The algorithm follows divide and conqer approach