Code Question Option A Option B Option C Option D Answer
CS301 Suppose Currentnode Refers To A Node In A Linked List (Using The Node Class With Member Variables Called Data And Nextnode). What Statement Changes Currentnode So That It Refers To The Next Node? Currentnode ++; Currentnode = Nextnode; Currentnode += Nextnode; Currentnode = Currentnode->Nextnode; D
CS301 Suppose N Is The Number Of Nodes In A Complete Binary Tree Then Maximum Steps Required For A Search Operation Are Log2 (N+1) -1 Log2 (N+1) Log2 (N) - 1 Log2 (N) A
CS301 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 ) 21 41 42 43 C
CS301 Suppose That The Class Declaration Of Someclass Includes The Following Function Prototype. Bool Lessthan( Someclass Anotherobject ); Which Of The Following Tests In The Client Code Correctly Compares Two Class Objects Alpha And Beta? If (Alpha < Beta) If (Alpha.Lessthan(Beta)) If (Lessthan(Alpha Beta)) If (Lessthan(Alpha).Beta) B
CS301 Suppose We Are Sorting An Array Of Eight Integers Using Quick Sort And We Have Just Finished The First Partitioning With The Array Looking Like This: 2 5 1 7 9 12 11 10 Which Statement Is Correct? The Pivot Could Be Either The 7 Or The 9 The Pivot Could Be The 7 But It Is Not The 9 The Pivot Is Not The 7 But It Could Be The 9 Neither The 7 Nor The 9 Is The Pivot A
CS301 Suppose We Had A Hash Table Whose Hash Function Is “N % 12” If The Number 35 Is Already In The Hash Table Which Of The Following Numbers Would Cause A Collision? 143 144 145 148 A
CS301 Suppose You Implement A Heap (With The Largest Element On Top) In An Array. Consider The Different Arrays Below Determine The One That Cannot Possibly Be A Heap 7 3 6 4 2 5 1 7 6 4 3 5 2 1 7 3 6 2 1 4 5 7 6 5 4 3 2 1 A
CS301 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: 16 18 20 22 24 28 30 16 20 18 24 22 30 28 16 24 18 28 30 20 22 16 24 20 30 28 18 22 D
CS301 The Arguments Passed To A Function Should Match In Number Type And Order With The Parameters In The Function Definition True False A
CS301 The Compiler Generates ____________________ Automatically Member Functions Classes Objects Of A Class Constructors D
CS301 The Data Of The Problem Is Of 2Gb And The Hard Disk Is Of 1Gb Capacity To Solve This Problem We Should Use Better Data Structures Increase The Hard Disk Space Use The Better Algorithm Use As Much Data As We Can Store On The Hard Disk B
CS301 The Definition Of Transitivity Property Is For All Element X Member Of S X R X For All Elements X And Y X R Y If And Only If Y R X For All Elements X Y And Z If X R Y And Y R Z Then X R Z For All Elements W X Y And Z If X R Y And W R Z Then X R Z C
CS301 The Difference Between A Binary Tree And A Binary Search Tree Is That A Binary Search Tree Has Two Children Per Node Whereas A Binary Tree Can Have None One Or Two Children Per Node In Binary Search Tree Nodes Are Inserted Based On The Values They Contain In Binary Tree Nodes Are Inserted Based On The Values They Contain None Of These A
CS301 The Easiest Case Of Deleting A Node From Bst Is The Case In Which The Node To Be Deleted __________ Is A Leaf Node Has Left Subtree Only Has Right Subtree Only Has Both Left And Right Subtree A
CS301 The Expression Ab+C* Is Called? Prefix Expression Postfix Expression Infix Expression None Of These B
CS301 The Main Reason Of Using Heap In Priority Queue Is Improve Performance Code Is Readable Less Code Heap Cant Be Used In Priority Queues A
CS301 The Maximum Number Of External Nodes (Leaves) For A Binary Tree Of Height H Is ___________ 2^H 2^H +1 2^H -1 2^H +2 A
CS301 The Method Of List Will Position The Currentnode And Lastcurrentnode At The Start Of The List Remove Next Start Back C
CS301 The Nodes With No Successor Are Called ___________ Leaf Nodes Root Nodes Both Of These None Of These A
CS301 The Operation For Adding An Entry To A Stack Is Traditionally Called Add Append Insert Push D