Data Structure FAQ
Data Structure FAQ
A data structure is a way of organizing the data so that the data can be used efficiently.
Different kinds of data structures are suited to different kinds of applications, and some
are highly specialized to specific tasks. For example, B-trees are particularly well-suited
for implementation of databases, while compiler implementations usually use hash tables
to look up identifiers.
What are the various operations that can be performed on different Data Structures?
Insertion − Add a new data item in the given collection of data items.
Deletion − Delete an existing data item from the given collection of data items.
Traversal − Access each data item exactly once so that it can be processed.
Searching − Find out the location of the data item if it exists in the given collection of data items.
Sorting − Arranging the data items in some order i.e. in ascending or descending order in case of
numerical data and in dictionary order in case of alphanumeric data.
Prefix notation (also known as “Polish notation”): + X Y Operators are written before
their operands. The expressions given above are equivalent to
/ * A + B C D
Which data structures are used for BFS and DFS of a graph?
Queue is used for BFS
Stack is used for DFS. DFS can also be implemented using recursion (Note that recursion
also uses function call stack).
Can doubly linked be implemented using a single pointer variable in every node?
Doubly linked list can be implemented using a single pointer