Unit 1: Introduction, Arrays, Sorting and Searching - Subjective Questions

CSE205 — Data Structures And Algorithms • Practice Questions with Detailed Answers

20 questions

1

Define an algorithm. Explain the basic characteristics of a good algorithm and the common notations used to represent algorithms.

2

What is complexity analysis? Distinguish between time complexity and space complexity with suitable examples.

3

Explain the time-space trade-off. Illustrate how additional memory can reduce execution time and how reduced memory can increase execution time.

4

Define Big O, Omega, and Theta notations formally. Explain the type of asymptotic bound represented by each notation.

5

Derive the asymptotic complexity of using Big O, Omega, and Theta notations.

6

What are basic data structures? Classify data structures and explain the position of arrays within this classification.

7

Define a linear array. Explain its important characteristics, advantages, and limitations.

8

Derive the address calculation formulas for elements of one-dimensional and two-dimensional arrays.

9

Describe array traversal and analyze its time and auxiliary space complexities. Give suitable pseudocode.

10

Explain how an element is inserted into a linear array at a specified position. Provide an algorithm and analyze its complexity.

11

Describe the deletion of an element from a linear array. State the necessary conditions and analyze the operation.

12

Explain how two sorted arrays are merged into one sorted array. Write an algorithm and derive its complexity.

13

Summarize and justify the time complexities of access, traversal, searching, insertion, deletion, sorting, and merging operations on arrays.

14

Describe bubble sort with an example. Derive its best-case and worst-case time complexities and state whether it is stable and in-place.

15

Explain insertion sort and trace it for the array . Analyze its efficiency and identify situations in which it is useful.

16

Describe selection sort and analyze the number of comparisons and swaps it performs. Is selection sort stable and adaptive?

17

Compare bubble sort, insertion sort, and selection sort in terms of complexity, stability, adaptiveness, swaps, and practical use.

18

Explain linear search with an algorithm. Analyze its best-case, average-case, and worst-case performance.

19

Describe binary search and trace the search for in . Derive its worst-case time complexity.

20

Compare linear search and binary search. Discuss their prerequisites, complexities, advantages, and suitable applications.