CS301 Final Term Exam Solved MCQs PDF - Spring 2010
Document Details

Uploaded by WieldyPhotorealism
Institute of E-Learning & Modern Studies (IEMS) Samundari
2010
VUI
Muhammad Moaaz Siddiq
Tags
Summary
This document contains solved multiple-choice questions (MCQs) from a final term examination in data structures (CS301) for Spring 2010. The material appears to be from VUI.
Full Transcript
CS301- Data Structures JAN 30,2011 LATEST SOLVED MCQS FROM FINALTERM PAPERS MC100401285 [email protected] [email protected] PSMD...
CS301- Data Structures JAN 30,2011 LATEST SOLVED MCQS FROM FINALTERM PAPERS MC100401285 [email protected] [email protected] PSMD01 FINALTERM EXAMINATION Spring 2010 Question No: 1 ( Marks: 1 ) - Please choose one A solution is said to be efficient if it solves the problem within its resource constraints i.e. hardware and time. â–º True (Page 4) â–º False Question No: 2 ( Marks: 1 ) - Please choose one Which one of the following is known as "Last-In, First-Out" or LIFO Data Structure? â–º Linked List â–º Stack (Page 54) â–º Queue â–º Tree Question No: 3 ( Marks: 1 ) - Please choose one What will be postfix expression of the following infix expression? Infix Expression : a+b*c-d â–º ab+c*d- â–º abc*+d- â–º abc+*d- â–º abcd+*- Question No: 4 ( Marks: 1 ) - Please choose one For compiler a postfix expression is easier to evaluate than infix expression? â–º True Click here for detail â–º False Question No: 5 ( Marks: 1 ) - Please choose one 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 Question No: 6 ( Marks: 1 ) - Please choose one 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. Question No: 22 ( Marks: 1 ) - Please choose one 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. Click here for detail â–º A find(x) on element x is performed by returning the whole tree itself containing x. â–º A find(x) on element x is performed by returning TRUE. Question No: 23 ( Marks: 1 ) - Please choose on 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. Question No: 24 ( Marks: 1 ) - Please choose one In complete binary tree the bottom level is filled from ________ â–º Left to right (Page 323) â–º Right to left â–º Not filled at all â–º None of the given options Question No: 25 ( Marks: 1 ) - Please choose one 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 (Page 477) â–º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 Question No: 26 ( Marks: 1 ) - Please choose one 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. Click here for detail â–º The array‟s size must be a power of two FINALTERM EXAMINATION Spring 2010 Question No: 1 ( Marks: 1 ) - Please choose one Which one of the following operations returns top value of the stack? â–º Push â–º Pop â–º Top (page 53) â–º First Question No: 2 ( Marks: 1 ) - Please choose one Compiler uses which one of the following in Function calls, â–º Stack (page 80) â–º Queue â–º Binary Search Tree â–º AVL Tree Question No: 3 ( Marks: 1 ) – Please choose one Every AVL is _________________ â–º Binary Tree â–º Complete Binary Tree â–º None of these â–º Binary Search Tree Click here for detail Question No: 4 ( Marks: 1 ) – Please choose one If there are 56 internal nodes in a binary tree then how many external nodes this binary tree will have? â–º 54 â–º 55 â–º 56 â–º 57 (page 303) Question No: 5 ( Marks: 1 ) - Please choose one 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 (page 303) Question No: 6 ( Marks: 1 ) - Please choose one Which one of the following is not an example of equivalence relation? â–º Electrical connectivity â–º Set of people â–º 0), where is the entry with the greatest value? Data is correct ï€ â–ºï€ data ï€ â–ºï€ data[n-1] ï€ â–ºï€ data[n] ï€ â–ºï€ data[2*n+1] Question No: 10 ( Marks: 1 ) - Please choose one If there are 56 internal nodes in a binary tree then how many external nodes this binary tree will have? â–º 54 â–º 55 â–º 56 â–º 57 (n+1) Question No: 11 ( Marks: 1 ) - Please choose one Which of the following heap method increase the value of key at position „p‟ by the amount „delta‟? â–º increaseKey(p,delta) (Page 363) â–º decreaseKey(p,delta) â–º preculateDown(p,delta) â–º remove(p,delta) Question No: 12 ( Marks: 1 ) - Please choose one If we have 1000 sets each containing a single different person. Which of the following relation will be true on each set: â–º Reflexive (page 387) â–º Symmetric â–º Transitive â–º Associative Question No: 13 ( Marks: 1 ) - Please choose one Which one of the following is not an example of equivalence relation: â–º Electrical connectivity â–º Set of people â–º