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); }
- 20
- 15
- 10
- 120
Q3: For the small data size, which one the following is the preferred data structure
- Single Linked List
- Double Linked List
- Array
- None of the above
Q4: Which one of the following data structure best suited to maintain a record of past events.
- Single Linked List
- Double Linked List
- Array
- Stack
Q5: Consider a sorted array of 1 million integers. Which algorithm best suited to apply the search:
- Binary Search
- Sequential search
- Quick Sort
- Bubble Sort
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
