1.
A linear collection of data elements where the linear node is given by means of the pointer is
Correct Answer
A. Linked list
Explanation
A linked list is a linear collection of data elements where each element, called a node, contains a value and a pointer that points to the next node in the list. This allows for efficient insertion and deletion operations at any position in the list. The other options, node list and primitive list, do not accurately describe this type of data structure. Therefore, the correct answer is linked list.
2.
Representation of data structure in memory is known as:
Correct Answer
B. Abstract data type
Explanation
The representation of a data structure in memory is known as an abstract data type. An abstract data type defines the behavior and properties of a data structure without specifying its implementation details. It provides a high-level view of the data structure, allowing users to interact with it through a set of predefined operations, while hiding the underlying implementation. This abstraction promotes code reusability, modularity, and encapsulation, making it easier to manage and manipulate complex data structures.
3.
An adjacency matrix representation of a graph cannot contain information of :
Correct Answer
D. Parallel edges
Explanation
An adjacency matrix representation of a graph cannot contain information about parallel edges. This is because an adjacency matrix is a two-dimensional array where each element represents the connection between two nodes. In this representation, a value of 1 indicates the presence of an edge between two nodes, while a value of 0 indicates the absence of an edge. However, since parallel edges refer to multiple edges between the same pair of nodes, it is not possible to represent this information in an adjacency matrix as it can only store binary values for edge presence or absence.
4.
Quicksort is also known as
Correct Answer
D. None of these
Explanation
Quicksort is not known as merge sort, heap sort, or bubble sort. It is a sorting algorithm in its own right and is distinct from these other sorting algorithms.
5.
Which of the following data structure is linear data structure?
Correct Answer
C. Arrays
Explanation
Arrays are a linear data structure because they store elements in a contiguous memory location. Each element in an array can be accessed using its index, which represents its position in the array. This allows for efficient random access to elements. Additionally, arrays have a fixed size, and elements can be easily inserted or deleted at the beginning or end of the array. Thus, arrays follow a linear order and are considered a linear data structure.
6.
The best average behaviour is shown by
Correct Answer
A. Quick Sort
Explanation
Quick Sort has the best average behavior among the given sorting algorithms. It is a divide-and-conquer algorithm that works by selecting a pivot element and partitioning the array around it. This process is repeated recursively on the sub-arrays until the entire array is sorted. Quick Sort has an average time complexity of O(n log n), which makes it efficient for large datasets. It also has good cache performance and can be implemented in-place, requiring little additional memory. Overall, Quick Sort is known for its fast average case performance, making it the best choice among the given options.
7.
A queue is a,
Correct Answer
A. FIFO (First In First Out) list.
Explanation
A queue follows the FIFO (First In First Out) principle, meaning that the first element inserted into the queue is the first one to be removed. This is similar to a line of people waiting for a service, where the person who arrives first is the first to be served. Therefore, the correct answer is FIFO (First In First Out) list.
8.
Which data structure is needed to convert infix notation to postfix notation?
Correct Answer
D. Stack
Explanation
A stack is needed to convert infix notation to postfix notation. In infix notation, operators are written between operands, while in postfix notation, operators are written after the operands. To convert infix to postfix, we scan the infix expression from left to right and push operands onto the stack. When an operator is encountered, we compare its precedence with the top of the stack. If the operator has higher precedence, we push it onto the stack. If the operator has lower or equal precedence, we pop operators from the stack and append them to the postfix expression until we find an operator with lower precedence or an opening parenthesis.
9.
The postfix form of the expression (A+ B)*(C*D− E)*F / G is
Correct Answer
A. AB+ CD*E − FG /**
Explanation
The given expression is in infix form. To convert it to postfix form, we use the following rules:
1. Start scanning the expression from left to right.
2. If an operand is encountered, add it to the postfix expression.
3. If an operator is encountered, check the precedence of the operator with the top of the stack.
a. If the precedence of the operator is higher than the top of the stack, push it onto the stack.
b. If the precedence of the operator is lower than or equal to the top of the stack, pop the operators from the stack until a lower precedence operator is encountered or the stack is empty. Then push the current operator onto the stack.
4. If a left parenthesis is encountered, push it onto the stack.
5. If a right parenthesis is encountered, pop the operators from the stack until a left parenthesis is encountered. Pop and add the left parenthesis to the postfix expression.
6. Repeat steps 2-5 until the expression is scanned completely.
7. Pop the remaining operators from the stack and add them to the postfix expression.
Applying these rules, the postfix form of the given expression is AB+ CD*E − FG /**.
10.
A full binary tree with n leaves contains
Correct Answer
C. 2n –1 nodes.
Explanation
A full binary tree is a binary tree in which each node has either 0 or 2 children. In such a tree, the number of nodes can be calculated using the formula 2n - 1, where n is the number of leaves. This formula holds true because each internal node (node with 2 children) contributes to the total count of nodes, and there are exactly n - 1 internal nodes in a full binary tree with n leaves. Therefore, the correct answer is 2n - 1 nodes.