• Home
  • Textbooks
  • Data Structures Using C
  • Fundamental Principles of Algorithm and Recursion

Data Structures Using C

Amol M. Jagtap, Ajit S. Mali

Chapter 1

Fundamental Principles of Algorithm and Recursion - all with Video Answers

Educators


Chapter Questions

Problem 1

Which of the following issues cannot be resolved by recursion?
A. Factorial of a number
B. Finding of a prime number
C. Problems without base case
D. Finding of sum of digits in any number

Check back soon!

Problem 2

The recursion process is identical with which of the following construct?
A. Switch case
B. If else
C. Loop
D. if else if ladder

Check back soon!

Problem 3

What will be the output of the following code?
```
finclude<stdio.h>
void recursion(int n)
l
if(n -- 0)
return;
printf("$d",n):
recursion(n-2);
l
int main()
I
recursion (6);
return 0;
l
```
A. 642
B. 654321
C. 662
D. 6420

Check back soon!

Problem 4

Which of the following data structure used to implement recursion in the main memory?
A. Stack
B. Array
C. Linked list
D. Tree

Check back soon!

Problem 5

What will be the output of the following C code?
```
#include<stdio.h>
int main()
l
printf("Hello atudenta");
main();
return 0;
l
```
A. Hello students is printed once
B. Hello students is printed infinite times
C. Hello students is printed till the stack overflows occur
D. None of the above

Check back soon!

Problem 6

A sequential solution of any program that is written in any natural language is called as:
A. Flowchart
B. Algorithm
C. Method
D. A and B both

Check back soon!

Problem 7

Which of the following code describes how you would implement an algorithm without getting into syntactical details.
A. Program code
B. Pseudo-code
C. Machine-level code
D. Binary code

Check back soon!

Problem 8

Which of the following is true for ADT that is ADT?
I. ADT is a type or class for objects whose behavior is defined by a set of values and a set of functions.
II. ADT is only stating that what operations are to be carried out.
III. ADT does not mention how data will be organized in memory.
A. I and II are correct
B. Only I is correct
C. II and III are correct
D. I, II and III are correct

Check back soon!

Problem 9

Algorithm efficiency or performance analysis of an algorithm is concerned with which of the following things.
A. Time complexity
B. Space complexity
C. Both A and B
D. None of the above

Check back soon!

Problem 10

Elements of program space within space complexity include which of the following.
A. Instruction space
B. Data space
C. Stack space
D. All the above

Check back soon!

Problem 11

Which of the following statements is false or true?
1. Pseudo-code is an informal language used by programmers to develop algorithms.
2. The pseudo-code contains no variable declaration.
A. Statement 1 is false
B. Statement 2 is false
C. Statements 1 and 2 both are false
D. Statements 1 and 2 both are true Answer: (D)

Check back soon!

Problem 12

Which of the following statements is false or true?
1. A flowchart is a kind of diagram which represents an algorithmic program, a workflow or operations.
2. A sequential solution of any program that is scripted in any natural language is called as an algorithm.
A. Statement 1 is false
B. Statement 2 is false
C. Statements 1 and 2 both are false
D. Statements 1 and 2 both are true Answer: (D)

Check back soon!

Problem 13

Which of the following statements is false or true?
1. Space complexity is defined as the total amount of secondary memory a program needs to run to its completion.
2. The amount of time required for a program to compile is called as its time complexity.
A. Statement 1 is false
B. Statement 2 is false
C. Statements 1 and 2 both are false
D. Statements 1 and 2 both are true Answer: (C)

Check back soon!

Problem 14

Which of the following statements is false or true?
1. Minimum number of steps that can be executed for given inputs is called as best case.
2. Maximum number of steps that can be executed for given inputs is called as worst case.
A. Statement 1 is false
B. Statement 2 is false
C. Statements 1 and 2 both are false
D. Statements 1 and 2 both are true Answer: (D)

Check back soon!

Problem 15

Which of the following statements is false or true?
1. The recursive function is a function that is invoked by itself.
2. Algorithm A is considered direct recursive algorithm if it calls another algorithm B that in turn calls A.
A. Statement 1 is false
B. Statement 2 is false
C. Statements 1 and 2 both are false
D. Statements 1 and 2 both are true

Check back soon!