71. The data structure required to check whether an expression contains balanced parenthesis is
Answer: Stack
Explanation:Here is no explanation for this answer
Workspace
Societe Generale
72. The pre-order and post order traversal of a Binary Tree generates the same output. The tree can have maximum
Answer: One node
Explanation:Here is no explanation for this answer
Workspace
Societe Generale
73. Assume single linked list pseudo code as follows?
struct Node {
data
next
}
record List {
Node firstNode
}
function1(List list) {
obsoleteNode = list.firstNode; list.firstNode = list.firstNode.next; free obsoleteNode;
}
function2(node node) {
obsoleteNode = node.next; node.next= node.next.next; free obsoleteNode;
}
function3(Node node,Node newNode) {
newNode.next = node.next;node.next= newNode
}
function4(List list, Node newNode) {
newNode.next = list.firstNode; list.firstNode = newNode;
}
Answer: function3 inserts newNode after node
Explanation:Here is no explanation for this answer
Workspace
Commvault Societe Generale SAP Labs Capgemini
74. Consider a linked list of n elements. What is the time taken to insert an element after an element pointed by some pointer?
Answer: O(1)
Explanation:Here is no explanation for this answer
Workspace
Sopra Steria Societe Generale SAP Labs
75. In a linked list with n nodes, the time taken to insert an element after an element pointed by some pointer is
Answer: O(1)
Explanation:Here is no explanation for this answer
Workspace
Sopra Steria Societe Generale
76. Consider the following code segment in C to traverse a binary tree using the preorder
typedef struct tree {
int info;
struct *left;
struct *right;
}node;
void preorder(node *tree)
{
if (t)
{
Statementl
Statement2
Statement3
}
}
The above Statements should be
Answer: printf("%d", tree->info); preorder(tree->left); preorder(tree->right);
Explanation:Here is no explanation for this answer
Workspace
Commvault Capgemini Societe Generale
77. One can convert a binary tree into its mirror image by traversing it in
Answer: postorder
Explanation:Here is no explanation for this answer
Workspace
Societe Generale
78. A graph with n vertices will definitely have a parallel edge or self loop of the total number of edges are
Answer: more than n(n-1)/2
Explanation:Here is no explanation for this answer
Workspace
Societe Generale
79. Let A be an adjacency matrix of a graph G. The ij entry in the matrix A^k , gives
Answer: Shortest path of K edges from vertex Vi to vertex Vj.
Explanation:Here is no explanation for this answer
Workspace
Societe Generale
80. An adjacency matrix representation of a graph cannot contain information of :
Answer: parallel edges
Explanation:Here is no explanation for this answer
Workspace
Societe Generale