This document contains questions and answers related to data structures and algorithms in C programming. It is divided into 5 modules that cover topics such as C fundamentals, arrays, pointers, structures, stacks, queues, sorting, searching and recursion. The modules include explanation of concepts and example programs related to each topic. For example, Module 1 discusses control structures, arrays and passing arrays to functions. It provides sample programs for problems involving control structures, arrays and passing arrays. Module 2 covers pointers, strings and functions. Example programs demonstrated include operations on arrays and strings using pointers.
1 of 5
Download to read offline
More Related Content
Question Bank DS
1. DS Question Bank
Module1
1. Explain the structure of c-program with example.
2. Define data structures. Explain various types of data structures.
3. What are operators in C? Explain about Managing Input and
output operations.
4. Write about for(), while() and do-while looping and branching
statements in C, discuss with examples.
5. Interpret different string handling functions with example.(any
Five)
6. Explain formatted I/O functions.
Answers: - printf() and scanf() : Students have to write
syntax of the functions and give an example.
7. Explain unformatted I/O functions in C.
Answers: - getchar(), gets(), putchar(), puts(). Each
function with syntax and example.
8. Discuss controls structures in C.
Answers: - if, else-if, switch-case. Explanation with syntax
and example.
9. Discuss looping structures in C.
Answers: - for, while, do-while. Syntax with example.
10. Explain Decision Making and Branching statements.
Module 2
1.How to initialize array and how to declare array in C?
2. Define an array. How do you initialize arrays?
3. Discuss array as ADT.
2. 4.What is one dimensional array & 2 dimension array ? explain with
example.
5. Explain Function in c.
6. What are Built in function and User defined Function in C?
7. What are different ways of passing parameters to function?
Answers: - Call by value, call by address. Explanation with a
programming example.
8. Explain various operations on Strings.
Module 3
1.Explain Pointer arithmetic.
2. Explain Pointer with an example.
3. Describe about structure concept.
4. Explain what is Union with a sample snippet.
5. Describe Nested structures and storage classes in c
6. Explain pre-processor directives.
Module 4
1. List and explain working of stack data structure with example.
2. Define stack. Explain Primitive operations on stack.
3. How will you represents array of stack.
4. Explain about Implementation of stack using array.
5. what are the application of stack.
6. Define recursion. What are the features/characteristics of
recursive functions?
Answers: - Features: every time problem size should be
reducing and there must be at least one non-recursive
terminating condition.
7. Explain infix to post-fix conversion.
3. Module 5
1.Explain Primitive operation on Queue
2.Explain logical representation queue data structure in detailed with
example.
3. Explain different types of queue.
4.Explain Tower of Hanoi problem.
5. Explain tower of Hanoi problem along with its constraints.
Answers: - Constraints: every time only one disc should be
moved, and smaller disc must be kept on larger disc.
6. Define Queue. Explain operations on Queue.
7. What are the disadvantages of ordinary queue? How do you
overcome it? (ans: circular queue)
8. Explain the concept of priority queues.
9. Explain Meaning and types of Deques.
Programming Questions:
Module 1:
1. Programs involving control structures like–
a. Quadratic equation
b. Area of a triangle
c. Prime numbers generation
d. Finding sum of digits of a number
e. Checking for number palindrome
f. Sine series, cosine series etc.
2. Programs involving arrays like –
a. Sum and average of numbers
4. b. Matrix addition and multiplication etc.
3. Programs related to passing array to a function.
Module 2:
1. Programs on pointers like –
a. Finding sum and average of numbers using pointers to an
array
b. Passing pointers to function (this is nothing but call by
address)
c. Returning pointers from function
d. Pointers to functions
2. Programs on string operations without using built-in string
functions –
a. Finding length of a string
b. Concatenation of two strings
c. Copy a string to another string
d. Comparing two strings etc
Module 3:
1. Programs on sorting
a. Selection sort
b. Bubble sort
c. Insertion sort
d. Quick sort
2. Programs on searching
a. Binary search
b. Linear search
Module 4:
1. Programs on –
5. a. Stack implementation
b. Infix to postfix conversion
c. Evaluation of postfix expression
d. Fibonacci series
Module 5:
1.Programs on –
a. Factorial
b. GCD
c. Tower of Hanoi
2. Queue implementation i. Circular queue