CS301 Final Term Exam Solved MCQs PDF - Spring 2010

Document Details

WieldyPhotorealism

Uploaded by WieldyPhotorealism

Institute of E-Learning & Modern Studies (IEMS) Samundari

2010

VUI

Muhammad Moaaz Siddiq

Tags

data structures computer science final term exam solved mcqs

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 ►

Use Quizgecko on...
Browser
Browser