Podcast
Questions and Answers
A solution is said to be efficient if it solves the problem within its resource constraints i.e. hardware and time.
A solution is said to be efficient if it solves the problem within its resource constraints i.e. hardware and time.
True (A)
Which one of the following is known as "Last-In, First-Out" or LIFO Data Structure?
Which one of the following is known as "Last-In, First-Out" or LIFO Data Structure?
- Queue
- Linked List
- Tree
- Stack (correct)
What will be postfix expression of the following infix expression?
Infix Expression : a+b*c-d
What will be postfix expression of the following infix expression? Infix Expression : a+b*c-d
- abcd+*-
- abc*+d- (correct)
- abc+*d-
- ab+c*d-
For compiler a postfix expression is easier to evaluate than infix expression?
For compiler a postfix expression is easier to evaluate than infix expression?
What is written to the screen for the input "apples"?
What is written to the screen for the input "apples"?
What is printed by the call test_a(4)?
What is printed by the call test_a(4)?
If there are N external nodes in a binary tree then what will be the no. of internal nodes in this binary tree?
If there are N external nodes in a binary tree then what will be the no. of internal nodes in this binary tree?
If we have 1000 sets each containing a single different person. Which of the following relation will be true on each set?
If we have 1000 sets each containing a single different person. Which of the following relation will be true on each set?
Which one of the following is NOT the property of equivalence relation?
Which one of the following is NOT the property of equivalence relation?
A binary tree of N nodes has:
A binary tree of N nodes has:
The easiest case of deleting a node from BST is the case in which the node to be deleted:
The easiest case of deleting a node from BST is the case in which the node to be deleted:
If there are N elements in an array then the number of maximum steps needed to find an element using Binary Search is.
If there are N elements in an array then the number of maximum steps needed to find an element using Binary Search is.
Merge sort and quick sort both fall into the same category of sorting algorithms. What is this category?
Merge sort and quick sort both fall into the same category of sorting algorithms. What is this category?
If one pointer of the node in a binary tree is NULL then it will be a/an
If one pointer of the node in a binary tree is NULL then it will be a/an
We convert the ____ pointers of binary to threads in threaded binary tree.
We convert the ____ pointers of binary to threads in threaded binary tree.
If the bottom level of a binary tree is NOT completely filled, depicts that the tree is NOT a
If the bottom level of a binary tree is NOT completely filled, depicts that the tree is NOT a
What is the best definition of a collision in a hash table?
What is the best definition of a collision in a hash table?
For a perfect binary tree of height h, having N nodes, the sum of heights of nodes is
For a perfect binary tree of height h, having N nodes, the sum of heights of nodes is
If there are 56 internal nodes in a binary tree then how many external nodes this binary tree will have?
If there are 56 internal nodes in a binary tree then how many external nodes this binary tree will have?
Which of the following heap method increase the value of key at position ‘p' by the amount ‘delta'?
Which of the following heap method increase the value of key at position ‘p' by the amount ‘delta'?
Which one of the following is NOT a correct statement about Table ADT.
Which one of the following is NOT a correct statement about Table ADT.
In a perfectly balanced tree the insertion of a node needs
In a perfectly balanced tree the insertion of a node needs
We are given N items to build a heap, this can be done with ____ successive inserts.
We are given N items to build a heap, this can be done with ____ successive inserts.
A binary tree with 33 internal nodes has ____ links to internal nodes.
A binary tree with 33 internal nodes has ____ links to internal nodes.
Which of the following statement is true about dummy node of threaded binary tree?
Which of the following statement is true about dummy node of threaded binary tree?
A complete binary tree is a tree that is ____ filled, with the possible exception of the bottom level.
A complete binary tree is a tree that is ____ filled, with the possible exception of the bottom level.
If a complete binary tree has n number of nodes then its height will be.
If a complete binary tree has n number of nodes then its height will be.
Which of the following statement is correct about find(x) operation?
Which of the following statement is correct about find(x) operation?
A queue is a data structure where elements are inserted and removed from the top.
A queue is a data structure where elements are inserted and removed from the top.
Each node in doubly link list has ___.
Each node in doubly link list has ___.
I have implemented the queue with a linked list, keeping track of a front pointer and a rear pointer. Which of these pointers will change during an insertion into an EMPTY queue?
I have implemented the queue with a linked list, keeping track of a front pointer and a rear pointer. Which of these pointers will change during an insertion into an EMPTY queue?
Compiler uses which one of the following to evaluate a mathematical equation?
Compiler uses which one of the following to evaluate a mathematical equation?
A binary tree of N nodes has ____ levels.
A binary tree of N nodes has ____ levels.
Suppose that a selection sort of 100 items has completed 42 iterations of the main loop. How many items are now guaranteed to be in their final spot (never to be moved again)?
Suppose that a selection sort of 100 items has completed 42 iterations of the main loop. How many items are now guaranteed to be in their final spot (never to be moved again)?
Suppose you implement a Min heap (with the smallest element on top) in an array. Consider the different arrays below; determine the one that cannot possibly be a heap:
Suppose you implement a Min heap (with the smallest element on top) in an array. Consider the different arrays below; determine the one that cannot possibly be a heap:
Do you see any problem in the code of nextInOrder below?
Do you see any problem in the code of nextInOrder below?
Which of the following statement is NOT correct about find operation:
Which of the following statement is NOT correct about find operation:
In complete binary tree the bottom level is filled from ____
In complete binary tree the bottom level is filled from ____
Here is an array of ten integers: 5 3 8 9 17 0 26 4. The array after the FIRST iteration of the large loop in a selection sort (sorting from smallest to largest).
Here is an array of ten integers: 5 3 8 9 17 0 26 4. The array after the FIRST iteration of the large loop in a selection sort (sorting from smallest to largest).
What requirement is placed on an array, so that binary search may be used to locate an entry?
What requirement is placed on an array, so that binary search may be used to locate an entry?
Which one of the following operations returns top value of the stack?
Which one of the following operations returns top value of the stack?
Compiler uses which one of the following in Function calls,
Compiler uses which one of the following in Function calls,
Every AVL is ____
Every AVL is ____
Which one of the following is not an example of equivalence relation?
Which one of the following is not an example of equivalence relation?
Binary Search is an algorithm of searching, used with the ____ data.
Binary Search is an algorithm of searching, used with the ____ data.
Which one of the following is NOT true regarding the skip list?
Which one of the following is NOT true regarding the skip list?
A simple sorting algorithm like selection sort or bubble sort has a worst-case of ____
A simple sorting algorithm like selection sort or bubble sort has a worst-case of ____
Which of the following is a property of binary tree?
Which of the following is a property of binary tree?
By using ____, we avoid the recursive method of traversing a Tree, which makes use of stacks and consumes a lot of memory and time.
By using ____, we avoid the recursive method of traversing a Tree, which makes use of stacks and consumes a lot of memory and time.
Which formula is the best approximation for the depth of a heap with n nodes?
Which formula is the best approximation for the depth of a heap with n nodes?
Flashcards
Stack
Stack
A data structure that follows the Last-In, First-Out (LIFO) principle, meaning the last element added is the first one to be removed.
Linked List
Linked List
A data structure that uses a linear list to store elements, where each node points to the next node in the sequence.
Queue
Queue
A data structure where elements are added at the rear and removed from the front, following the First-In, First-Out (FIFO) principle.
Tree
Tree
Signup and view all the flashcards
Infix to Postfix Conversion
Infix to Postfix Conversion
Signup and view all the flashcards
Stack for Expression Evaluation
Stack for Expression Evaluation
Signup and view all the flashcards
Node Insertion in Binary Tree
Node Insertion in Binary Tree
Signup and view all the flashcards
Tree Traversal
Tree Traversal
Signup and view all the flashcards
AVL Tree
AVL Tree
Signup and view all the flashcards
Max Heap
Max Heap
Signup and view all the flashcards
Min Heap
Min Heap
Signup and view all the flashcards
Heap Insertion
Heap Insertion
Signup and view all the flashcards
Complete Binary Tree
Complete Binary Tree
Signup and view all the flashcards
Heap Deletion
Heap Deletion
Signup and view all the flashcards
Binary Search Tree
Binary Search Tree
Signup and view all the flashcards
Binary Search Tree Search
Binary Search Tree Search
Signup and view all the flashcards
Selection Sort
Selection Sort
Signup and view all the flashcards
Bubble Sort
Bubble Sort
Signup and view all the flashcards
Binary Search
Binary Search
Signup and view all the flashcards
Algorithm Analysis
Algorithm Analysis
Signup and view all the flashcards
Stack Overflow
Stack Overflow
Signup and view all the flashcards
Underflow
Underflow
Signup and view all the flashcards
Tree Node
Tree Node
Signup and view all the flashcards
Sorting Algorithm
Sorting Algorithm
Signup and view all the flashcards
Disjoint Set Data Structure
Disjoint Set Data Structure
Signup and view all the flashcards
Find Operation
Find Operation
Signup and view all the flashcards
Union Operation
Union Operation
Signup and view all the flashcards
Disjoint Sets
Disjoint Sets
Signup and view all the flashcards
Equivalence Relation
Equivalence Relation
Signup and view all the flashcards
Relation
Relation
Signup and view all the flashcards
Set Relation
Set Relation
Signup and view all the flashcards
Efficient Solution
Efficient Solution
Signup and view all the flashcards
Stack (LIFO)
Stack (LIFO)
Signup and view all the flashcards
Postfix Expression
Postfix Expression
Signup and view all the flashcards
Stack and Word Reversal
Stack and Word Reversal
Signup and view all the flashcards
Function with Logical Issues
Function with Logical Issues
Signup and view all the flashcards
Find Operation in Disjoint Sets
Find Operation in Disjoint Sets
Signup and view all the flashcards
Disjoint Sets: Single Node Tree
Disjoint Sets: Single Node Tree
Signup and view all the flashcards
Complete Binary Tree: Filling Last Level
Complete Binary Tree: Filling Last Level
Signup and view all the flashcards
Selection Sort: First Iteration
Selection Sort: First Iteration
Signup and view all the flashcards
Binary Search: Sorted Array
Binary Search: Sorted Array
Signup and view all the flashcards
Stack Operation: Top
Stack Operation: Top
Signup and view all the flashcards
Compiler Uses Stack for Function Calls
Compiler Uses Stack for Function Calls
Signup and view all the flashcards
AVL Tree: Binary Search Tree
AVL Tree: Binary Search Tree
Signup and view all the flashcards
Internal and External Nodes in Binary Tree
Internal and External Nodes in Binary Tree
Signup and view all the flashcards
Internal and External Nodes Relationship
Internal and External Nodes Relationship
Signup and view all the flashcards
Equivalence Relation: Example - People
Equivalence Relation: Example - People
Signup and view all the flashcards
Relation: Ordered Pairs
Relation: Ordered Pairs
Signup and view all the flashcards
Study Notes
CS301 - Data Structures - Final Term Examination - Spring 2010
-
Question 1 (Marks: 1): A solution is considered efficient if it solves the problem within hardware and time constraints.
- True (Page 4)
- False
-
Question 2 (Marks: 1): A Last-In, First-Out (LIFO) data structure is a Stack.
- Linked List
- Stack (Page 54)
- Queue
- Tree
-
Question 3 (Marks: 1): The postfix expression for the infix expression a + b * c - d is ab+c*d-.
- ab+c*d-
- abc*+d-
- abc+*d-
- abcd+*-
-
Question 4 (Marks: 1): For a compiler, a postfix expression is easier to evaluate than an infix expression.
- True (Click here for detail)
- False
-
Question 5 (Marks: 1): Given pseudo code that declares a stack of characters and reads a word, it will print the word in reverse order. Consider the input "apples"; the output will be "selpa."
- selpa
- selppa
- apples
- aaappppplleess
-
Question 6 (Marks: 1): This function outputs 4, 2, 0.
- void test_a(int n) { cout << n << " "; if(n>0) test_a(n-2); }
- Calling test_a(4) will produce "4 2 0".
- 42
- 024
- 02
- 24
-
Question 7 (Marks: 1): If there are N external nodes in a binary tree, the number of internal nodes will be N-1.
- N-1 (Page 304)
- N+1
- N+2
- N
-
Question 8 (Marks: 1): If there are N internal nodes in a binary tree, the number of external nodes will be N+1.
- N-1
- N
- N+1 (Page 303)
- N+2
-
Question 9 (Marks: 1): If there are 1000 sets of people with unique individuals in each set, the relationship will be reflexive. (Page 387)
- Reflexive
- Symmetric
- Transitive
- Associative
-
Question 10 (Marks: 1): One property that equivalence relations do not possess is associativity. (Page 387)
- Reflexive
- Symmetric
- Transitive
- Associative
-
Question 11 (Marks: 1): A binary tree with N nodes has Log₂N levels. (Page 212)
- Log₁₀N levels
- Log₂N levels
- N/ 2 levels
- N x 2 levels
-
Question 12 (Marks: 1): The easiest case for deleting a node from a binary search tree (BST) is when the node is a leaf node. (Page 173)
- Is a leaf node
- Has left subtree only
- Has right subtree only
- Has both left and right subtree
-
Question 13 (Marks: 1): Binary search on an array of N elements has a maximum number of steps of log₂N. (Page 440)
- N
- N²
- Nlog₂N
- log₂N
-
Question 14 (Marks: 1): Merge sort and quicksort are both O(n log n) sorts. (Page 488)
-
O(n log n) sorts
-
Interchange sort
-
Average time is quadratic
-
None of the given options
-
And many more questions... The provided text contains multiple exam questions with answers. More questions are included, covering various aspects of data structures. Some links to details are included for further learning.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
Test your knowledge of Data Structures with this final examination from CS301 Spring 2010. This quiz covers essential concepts like efficiency, data structures, and expression evaluation, providing a comprehensive review of key topics. Assess your understanding of stacks, queues, and postfix expressions.