This section includes 7 InterviewSolutions, each offering curated multiple-choice questions to sharpen your Current Affairs knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Difference Between Abstract Data Type, Data Type And Data Structure? |
Answer»
i.e) Data type has its root in the abstract data type and a data structure comprises a set of computer variables of same or different data types. i.e) Data type has its root in the abstract data type and a data structure comprises a set of computer variables of same or different data types. |
|
| 2. |
Define Data Type And What Are The Types Of Data Type? |
|
Answer» Data type refers to the kinds of data that VARIABLES may hold in the programming language. Eg) int, float, char, double – C The following are the TYPES of data type:
Eg: typedef struct STUDENT { int roll; char name; }S; S s1;Where S is a tag for user defined data type which defines the STRUCTURE student and s1 is a variable of data type S. Data type refers to the kinds of data that variables may hold in the programming language. Eg) int, float, char, double – C The following are the types of data type: Eg: typedef struct student Where S is a tag for user defined data type which defines the structure student and s1 is a variable of data type S. |
|
| 3. |
Define An Abstract Data Type (adt)? |
|
Answer» An abstract DATA type is a set of operations. ADTs are MATHEMATICAL abstractions; now here in an ADT’s definition is there any mention of how the set of operations is implemented. Objects such as lists, SETS and graphs, along with their operations can be VIEWED as abstract data types. An abstract data type is a set of operations. ADTs are mathematical abstractions; now here in an ADT’s definition is there any mention of how the set of operations is implemented. Objects such as lists, sets and graphs, along with their operations can be viewed as abstract data types. |
|
| 4. |
What Are The Advantages Of Modularity? |
| Answer» | |
| 5. |
State The Difference Between Primitive And Non-primitive Data Types? |
|
Answer» Primitive DATA types are the fundamental data types. Eg) INT, float, double, CHAR Non-primitive data types are USER defined data types. Eg) STRUCTURE, Union and enumerated data types. Primitive data types are the fundamental data types. Eg) int, float, double, char Non-primitive data types are user defined data types. Eg) Structure, Union and enumerated data types. |
|
| 6. |
State The Difference Between Persistent And Ephemeral Data Structure? |
|
Answer» Persistent DATA structures are the data structures which RETAIN their PREVIOUS state and modifications can be DONE by performing certain operations on it. Eg) Stack Ephemeral data structures are the data structures which cannot retain its previous state. Eg) Queues. Persistent data structures are the data structures which retain their previous state and modifications can be done by performing certain operations on it. Eg) Stack Ephemeral data structures are the data structures which cannot retain its previous state. Eg) Queues. |
|
| 7. |
What Are The Objectives Of Studying Data Structures? |
Answer»
|
|
| 8. |
What Are The Types Of Queues? |
Answer»
|
|
| 9. |
List The Applications Of Stacks? |
Answer»
|
|
| 10. |
List The Applications Of Queues? |
| Answer» | |
| 11. |
Why We Need Cursor Implementation Of Linked Lists? |
|
Answer» MANY languages such as BASIC and FORTRAN do not support pointers. If linked LISTS are required and pointers are not available, then an alternative implementation must be used KNOWN as cursor implementation. Many languages such as BASIC and FORTRAN do not support pointers. If linked lists are required and pointers are not available, then an alternative implementation must be used known as cursor implementation. |
|
| 12. |
Define A Tree? |
|
Answer» A tree is a collection of nodes. The collection can be empty; otherwise, a tree consists of a distinguished node r, called the root, and zero or more nonempty (sub) trees T1, T2,…,Tk, each of whose roots are CONNECTED by a DIRECTED edge from r. A tree is a collection of nodes. The collection can be empty; otherwise, a tree consists of a distinguished node r, called the root, and zero or more nonempty (sub) trees T1, T2,…,Tk, each of whose roots are connected by a directed edge from r. |
|
| 13. |
Define Root? |
|
Answer» This is the UNIQUE NODE in the TREE to which further sub-trees are ATTACHED. This is the unique node in the tree to which further sub-trees are attached. |
|
| 14. |
Define Degree Of The Node? |
|
Answer» The TOTAL NUMBER of sub-trees attached to that NODE is called the degree of the node. The total number of sub-trees attached to that node is called the degree of the node. |
|
| 15. |
Define Leaves? |
|
Answer» These are the TERMINAL nodes of the TREE. The nodes with degree 0 are always the LEAVES. Here C and B are the LEAVE nodes. These are the terminal nodes of the tree. The nodes with degree 0 are always the leaves. Here C and B are the leave nodes. |
|
| 16. |
Define Internal Nodes? |
|
Answer» The NODES other than the ROOT and the LEAVES are CALLED INTERNAL nodes. The nodes other than the root and the leaves are called internal nodes. |
|
| 17. |
Define Parent Node? |
|
Answer» The NODE which is having further sub-branches is CALLED the PARENT node of those sub-branches. Here C is the parent node of D and E. The node which is having further sub-branches is called the parent node of those sub-branches. Here C is the parent node of D and E. |
|
| 18. |
Define Depth And Height Of A Node? |
|
Answer» For any NODE ni, the depth of ni is the length of the UNIQUE path from the ROOT to ni. The height of ni is the length of the longest path from ni to a LEAF. For any node ni, the depth of ni is the length of the unique path from the root to ni. The height of ni is the length of the longest path from ni to a leaf. |
|
| 19. |
Define Depth And Height Of A Tree? |
|
Answer» The depth of the TREE is the depth of the DEEPEST LEAF. The height of the tree is EQUAL to the height of the root. Always depth of the tree is equal to height of the tree. The depth of the tree is the depth of the deepest leaf. The height of the tree is equal to the height of the root. Always depth of the tree is equal to height of the tree. |
|
| 20. |
What Do You Mean By Level Of The Tree? |
|
Answer» The ROOT NODE is always considered at level zero, then its adjacent CHILDREN are supposed to be at level 1 and so on. Here, node A is at level 0, nodes B and C are at level 1 and nodes D and E are at level 2. The root node is always considered at level zero, then its adjacent children are supposed to be at level 1 and so on. Here, node A is at level 0, nodes B and C are at level 1 and nodes D and E are at level 2. |
|
| 21. |
Define Forest? |
|
Answer» A TREE may be DEFINED as a forest in which only a SINGLE NODE (root) has no PREDECESSORS. Any forest consists of a collection of trees. A tree may be defined as a forest in which only a single node (root) has no predecessors. Any forest consists of a collection of trees. |
|
| 22. |
Define A Binary Tree? |
|
Answer» A BINARY tree is a finite set of NODES which is either EMPTY or consists of a root and two disjoint binary trees called the LEFT sub-tree and right sub-tree. A binary tree is a finite set of nodes which is either empty or consists of a root and two disjoint binary trees called the left sub-tree and right sub-tree. |
|
| 23. |
Define A Path In A Tree? |
|
Answer» A PATH in a TREE is a sequence of distinct nodes in which SUCCESSIVE nodes are CONNECTED by EDGES in the tree. A path in a tree is a sequence of distinct nodes in which successive nodes are connected by edges in the tree. |
|
| 24. |
Define Terminal Nodes In A Tree? |
|
Answer» A node that has no CHILDREN is called a TERMINAL node. It is also REFERRED to as LEAF node. A node that has no children is called a terminal node. It is also referred to as leaf node. |
|
| 25. |
Define Non-terminal Nodes In A Tree? |
|
Answer» All INTERMEDIATE nodes that traverse the GIVEN tree from its root node to the TERMINAL nodes are REFERRED as non-terminal nodes. All intermediate nodes that traverse the given tree from its root node to the terminal nodes are referred as non-terminal nodes. |
|
| 26. |
Define A Full Binary Tree ? |
|
Answer» A full binary tree is a tree in which all the LEAVES are on the same LEVEL and EVERY non-leaf node has exactly TWO CHILDREN. A full binary tree is a tree in which all the leaves are on the same level and every non-leaf node has exactly two children. |
|
| 27. |
Define A Complete Binary Tree? |
|
Answer» A COMPLETE BINARY tree is a tree in which every non-leaf NODE has EXACTLY two CHILDREN not necessarily to be on the same level. A complete binary tree is a tree in which every non-leaf node has exactly two children not necessarily to be on the same level. |
|
| 28. |
Define A Right-skewed Binary Tree? |
|
Answer» A RIGHT-skewed BINARY TREE is a tree, which has only right CHILD NODES. A right-skewed binary tree is a tree, which has only right child nodes. |
|
| 29. |
State The Properties Of A Binary Tree? |
| Answer» | |
| 30. |
What Is Meant By Binary Tree Traversal? |
|
Answer» Traversing a binary TREE MEANS moving through all the nodes in the binary tree, VISITING each node in the tree only once. Traversing a binary tree means moving through all the nodes in the binary tree, visiting each node in the tree only once. |
|
| 31. |
What Are The Different Binary Tree Traversal Techniques? |
| Answer» | |
| 32. |
What Are The Tasks Performed While Traversing A Binary Tree? |
| Answer» | |
| 33. |
What Are The Tasks Performed During Preorder Traversal? |
| Answer» | |
| 34. |
What Are The Tasks Performed During Inorder Traversal? |
| Answer» | |
| 35. |
What Are The Tasks Performed During Postorder Traversal? |
| Answer» | |
| 36. |
State The Merits Of Linear Representation Of Binary Trees? |
Answer»
|
|
| 37. |
State The Demerit Of Linear Representation Of Binary Trees? |
|
Answer» INSERTIONS and deletions in a NODE take an EXCESSIVE amount of processing TIME due to data movement up and down the array. Insertions and deletions in a node take an excessive amount of processing time due to data movement up and down the array. |
|
| 38. |
State The Merit Of Linked Representation Of Binary Trees? |
|
Answer» Insertions and deletions in a NODE involve no data movement except the rearrangement of POINTERS, hence LESS processing TIME. Insertions and deletions in a node involve no data movement except the rearrangement of pointers, hence less processing time. |
|
| 39. |
State The Demerits Of Linked Representation Of Binary Trees? |
Answer»
|
|
| 40. |
Define A Binary Search Tree? |
|
Answer» A binary search tree is a special binary tree, which is either empty or it should satisfy the following characteristics:
A binary search tree is a special binary tree, which is either empty or it should satisfy the following characteristics: |
|
| 41. |
What Do You Mean By General Trees? |
|
Answer» GENERAL TREE is a tree with NODES having any NUMBER of CHILDREN. General tree is a tree with nodes having any number of children. |
|
| 42. |
Define Ancestor And Descendant ? |
|
Answer» If there is a PATH from NODE n1 to N2, then n1 is the ANCESTOR of n2 and n2 is the DESCENDANT of n1. If there is a path from node n1 to n2, then n1 is the ancestor of n2 and n2 is the descendant of n1. |
|
| 43. |
Why It Is Said That Searching A Node In A Binary Search Tree Is Efficient Than That Of A Simple Binary Tree? |
|
Answer» In binary search tree, the nodes are arranged in such a way that the left node is having less data value than ROOT node value and the right nodes are having larger value than that of root. Because of this while searching any node the value of the TARGET node will be compared with the parent node and accordingly either left sub branch or right sub branch will be searched. So, ONE has to compare only PARTICULAR branches. Thus searching BECOMES efficient. In binary search tree, the nodes are arranged in such a way that the left node is having less data value than root node value and the right nodes are having larger value than that of root. Because of this while searching any node the value of the target node will be compared with the parent node and accordingly either left sub branch or right sub branch will be searched. So, one has to compare only particular branches. Thus searching becomes efficient. |
|
| 44. |
What Is The Use Of Threaded Binary Tree? |
|
Answer» In THREADED BINARY tree, the NULL POINTERS are replaced by some addresses. The left pointer of the NODE points to its predecessor and the right pointer of the node points to its successor. In threaded binary tree, the NULL pointers are replaced by some addresses. The left pointer of the node points to its predecessor and the right pointer of the node points to its successor. |
|
| 45. |
What Is An Expression Tree? |
|
Answer» An EXPRESSION tree is a tree which is build from infix or PREFIX or postfix expression. GENERALLY, in such a tree, the leaves are OPERANDS and other nodes are operators. An expression tree is a tree which is build from infix or prefix or postfix expression. Generally, in such a tree, the leaves are operands and other nodes are operators. |
|
| 46. |
Define Right-in Threaded Tree? |
|
Answer» Right-in THREADED binary tree is defined as one in which THREADS REPLACE NULL pointers in nodes with empty right sub-trees. Right-in threaded binary tree is defined as one in which threads replace NULL pointers in nodes with empty right sub-trees. |
|
| 47. |
Define Left-in Threaded Tree? |
|
Answer» Left-in threaded binary TREE is DEFINED as ONE in which each NULL pointers is altered to CONTAIN a thread to that node’s inorder PREDECESSOR. Left-in threaded binary tree is defined as one in which each NULL pointers is altered to contain a thread to that node’s inorder predecessor. |
|
| 48. |
Define Avl Tree? |
|
Answer» An empty tree is height balanced. If T is a non-empty BINARY tree with TL and TR as its LEFT and right subtrees, then T is height balanced if
Where hL and hR are the heights of TL and TR respectively. An empty tree is height balanced. If T is a non-empty binary tree with TL and TR as its left and right subtrees, then T is height balanced if Where hL and hR are the heights of TL and TR respectively. |
|
| 49. |
What Do You Mean By Balanced Trees? |
|
Answer» BALANCED TREES have the structure of binary trees and obey binary search tree properties. Apart from these properties, they have some special constraints, which differ from one data structure to another. However, these constraints are aimed only at reducing the height of the tree, because this factor determines the time complexity. Balanced trees have the structure of binary trees and obey binary search tree properties. Apart from these properties, they have some special constraints, which differ from one data structure to another. However, these constraints are aimed only at reducing the height of the tree, because this factor determines the time complexity. Eg: AVL trees, Splay trees. |
|
| 50. |
What Are The Categories Of Avl Rotations? |
|
Answer» Let A be the nearest ANCESTOR of the newly INSERTED NOD which has the balancing factor ±2. Then the rotations can be classified into the following four categories: Left-Left: The newly inserted node is in the left subtree of the left child of A. Let A be the nearest ancestor of the newly inserted nod which has the balancing factor ±2. Then the rotations can be classified into the following four categories: Left-Left: The newly inserted node is in the left subtree of the left child of A. |
|