Question: Q2: What is the output for the code fragment given below for a call function (5)? function(int n) { if ( n == 0 )

Q2: What is the output for the code fragment given below for a call function (5)?

function(int n) { if ( n == 0 ) return 0; else return n + function(n-1); }

  1. 20
  2. 15
  3. 10
  4. 120

Q3: For the small data size, which one the following is the preferred data structure

  1. Single Linked List
  2. Double Linked List
  3. Array
  4. None of the above

Q4: Which one of the following data structure best suited to maintain a record of past events.

  1. Single Linked List
  2. Double Linked List
  3. Array
  4. Stack

Q5: Consider a sorted array of 1 million integers. Which algorithm best suited to apply the search:

  1. Binary Search
  2. Sequential search
  3. Quick Sort
  4. Bubble Sort

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!