CS301 Final Term Exam Questions PDF
Document Details
Uploaded by WieldyPhotorealism
Institute of E-Learning & Modern Studies (IEMS) Samundari
Tags
Related
- Data Structures & Algorithms Lecture Notes 1 PDF
- Data Structures - Ellis Horowitz, Sartaj Sahni - Fundamentals - PDF
- Data Structures and Algorithms Study Guide (Sorsogon State University)
- CS301 Data Structures Past Paper PDF 2010
- Introduction to Java Programming and Data Structures (2019) by Y. Daniel Liang - PDF
- Data Structures and Algorithms with Python and C++ PDF
Summary
This document contains a selection of multiple-choice questions from a CS301 course, primarily focusing on data structures and algorithms concepts. The quiz covers topics like postfix expressions, stacks, binary trees, trees, and sorting algorithms.
Full Transcript
**1. A solution is said to be efficient if it solves the problem within its resource constraints i.e. hardware and time.** **True ** **False** **2. Which one of the following is known as \"Last-In, First-Out\" or LIFO Data Structure?** **Linked List ** **Stack ** **Queue** **Tree** **3. For...
**1. A solution is said to be efficient if it solves the problem within its resource constraints i.e. hardware and time.** **True ** **False** **2. Which one of the following is known as \"Last-In, First-Out\" or LIFO Data Structure?** **Linked List ** **Stack ** **Queue** **Tree** **3. For compiler a postfix expression is easier to evaluate than infix expression?** **True** **False ** **4. Consider the following pseudo code declare a stack of characters** while ( there are more characters in the word to read ) { read a character push the character on the stack } while ( the stack is not empty ) { pop a character off the stack write the character to the screen } **What is written to the screen for the input \"apples\"?** **selpa ** **selppa** **apples** **aaappppplleess** **5. Consider the following function: ** void test\_a(int n) { cout \RTH == thread) return( p-\>R ); else { p = p-\>R; while(p-\>LTH == child) p = p-\>R; return p; } } **The function has no problem and will fulfill the purpose successfully** **The function cannot be compile as it has syntax error** **The function has logical problem, therefore, it will not work properly** **The function will be compiled but will throw runtime exception immediately after the control is transferred to this function** **19. Which of the following statement is correct about find(x) operation:** **A find(x) on element x is performed by returning exactly the same node that is found.** **A find(x) on element x is performed by returning the root of the tree containing x. ** **A find(x) on element x is performed by returning the whole tree itself containing x.D. ** **A find(x) on element x is performed by returning TRUE** **20. Which of the following statement is NOT correct about find operation:** **It is not a requirement that a find operation returns any specific name, just that finds on two elements return the same answer if and only if they are in the same set.** **One idea might be to use a tree to represent each set, since each element in a tree has the same root, thus the root can be used to name the set.** **Initially each set contains one element.** **Initially each set contains one element and it does not make sense to make a tree of one node only.** **21. In complete binary tree the bottom level is filled from \_\_\_\_\_\_\_\_** **Left to right** **Right to left** **Not filled at all** **None of the given options** **22. Here is an array of ten integers: ** **5 3 8 9 1 7 0 2 6 4 ** **The array after the FIRST iteration of the large loop in a selection sort (sorting from smallest to largest).** **0 3 8 9 1 7 5 2 6 4 ** **2 6 4 0 3 8 9 1 7 5** **2 6 4 9 1 7 0 3 8 5** **0 3 8 2 6 4 9 1 7 5** **23. What requirement is placed on an array, so that binary search may be used to locate an entry?** **The array elements must form a heap** **The array must have at least 2 entries** **The array must be sorted.** **The array‟s size must be a power of two** **24. Which one of the following operations returns top value of the stack?** **Push** **Pop** **Top** **First** **25. Compiler uses which one of the following in Function calls,** **Stack** **Queue** **Binary Search TreeD. ** **AVL Tree** **26. Every AVL is \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_** **Binary Tree** **Complete Binary Tree** **None of these** **Binary Search Tree** **27. If there are 56 internal nodes in a binary tree then how many external nodes this binary tree will have?** **54** **55** **56** **57** **28. If there are 23 external nodes in a binary tree then what will be the no. of internal nodes in this binary tree?** **23** **24** **21** **22** **29. Which one of the following is not an example of equivalence relation?** **Electrical connectivity** **Set of people** **\