Algorithms and Algorithmic Strategies: book back answers

18 solved questions from the end of this chapter, Class 12 Computer Science, Tamil Nadu State Board. Each answer is checked against the textbook, and you can open the page that proves it.

← Notes and quiz for Algorithms and Algorithmic Strategies

Choose the best answer: (1 Marks)

  1. The word comes from the name of a Persian mathematician Abu Ja’far Mohammed ibn-i Musa al Khowarizmi is called?

    • (A) Flowchart
    • (B) Flow
    • (C) Algorithm
    • (D) Syntax
    Try it, then show the answer

    (C) Algorithm

    The chapter says the word Algorithm comes from the name of the Persian author Abu Jafar Mohammed ibn Musa al Khowarizmi.

    From the book: “The word Algorithm comes from the name of a Persian author”

  2. From the following sorting algorithms which algorithm needs the minimum number of swaps?

    • (A) Bubble sort
    • (B) Insertion sort
    • (C) Selection sort
    • (D) All the above
    Try it, then show the answer

    (C) Selection sort

    Selection sort makes only one exchange for every pass through the list, improving on bubble sort. The chapter does not give a swap comparison with insertion sort, but describes selection sort's minimum exchanges.

    From the book: “making only one exchange for every pass through the list”

  3. Two main measures for the efficiency of an algorithm are

    • (A) Processor and memory
    • (B) Complexity and capacity
    • (C) Time and space
    • (D) Data and space
    Try it, then show the answer

    (C) Time and space

    The chapter identifies time and space complexity as the two main factors that decide algorithm efficiency.

    From the book: “the time and space used by the algorithm A are the two main factors”

  4. The algorithm that yields expected output for a valid input in called as

    • (A) Algorithmic solution
    • (B) Algorithmic outcomes
    • (C) Algorithmic problem
    • (D) Algorithmic coding
    Try it, then show the answer

    (A) Algorithmic solution

    The chapter defines an algorithm yielding expected output for valid input as an algorithmic solution.

    From the book: “An algorithm that yields expected output for a valid input is called an algorithmic solution.”

  5. Which of the following is used to describe the worst case of an algorithm?

    • (A) Big A
    • (B) Big S
    • (C) Big W
    • (D) Big O
    Try it, then show the answer

    (D) Big O

    Big O is used to describe an algorithm's worst case.

    From the book: “Big O is often used to describe the worst-case of an algorithm.”

  6. Big Ω is the reverse of

    • (A) Big O
    • (B) Big θ
    • (C) Big A
    • (D) Big S
    Try it, then show the answer

    (A) Big O

    The chapter explicitly describes Big Omega as the reverse of Big O.

    From the book: “Big Omega is the reverse Big O”

  7. Binary search is also called as

    • (A) Linear search
    • (B) Sequential search
    • (C) Random search
    • (D) Half-interval search
    Try it, then show the answer

    (D) Half-interval search

    The chapter states that binary search is also called half-interval search.

    From the book: “Binary search also called half-interval search algorithm.”

  8. If a problem can be broken into subproblems which are reused several times, the problem possesses which property?

    • (A) Overlapping subproblems
    • (B) Optimal substructure
    • (C) Memoization
    • (D) Greedy
    Try it, then show the answer

    (A) Overlapping subproblems

    The chapter describes dynamic programming as dividing a problem into smaller overlapping sub-problems whose results can be reused.

    From the book: “The given problem will be divided into smaller overlapping sub-problems.”

  9. In dynamic programming, the technique of storing the previously calculated values is called ?

    • (A) Saving value property
    • (B) Storing value property
    • (C) Memoization
    • (D) Mapping
    Try it, then show the answer

    (C) Memoization

    Memoization stores results of previous function calls and returns cached results when the same inputs occur again.

    From the book: “Memoization or memoisation is an optimization technique used primarily to speed up computer programs by storing the results of previous function calls”

Part - II — Answer the following questions (2 Marks)

  1. What is an Algorithm?

    Try it, then show the answer

    An algorithm is a finite set of instructions to accomplish a particular task. It is a step-by-step procedure for solving a given problem.

    An algorithm gives ordered instructions for carrying out a task and can be implemented in a suitable programming language.

    From the book: “An algorithm is a finite set of instructions to accomplish a particular task.”

  2. What is Insertion sort?

    Try it, then show the answer

    Insertion sort is a sorting algorithm that takes elements from a list one by one and inserts them into their correct positions in a sorted list.

    It builds the final sorted array incrementally, maintaining a sorted part as each item is inserted.

    From the book: “It works by taking elements from the list one by one and inserting then in their correct position”

  3. What is Sorting?

    Try it, then show the answer

    Sorting is arranging items in a certain order using methods such as bubble sort, insertion sort, or selection sort.

    Sorting places the items of a data structure into the required order.

    From the book: “To sort items in a certain order using the methods such as bubble sort, insertion sort, selection sort, etc.”

  4. What is searching? Write its types.

    Try it, then show the answer

    Searching is finding an item in a data structure. Its types described in the chapter are linear search and binary search.

    Linear search checks items sequentially; binary search finds a position in a sorted array by repeatedly narrowing the search interval.

    From the book: “To search an item in a data structure using linear and binary search.”

Part - III — Answer the following questions (3 Marks)

  1. List the characteristics of an algorithm.

    Try it, then show the answer

    Input, output, finiteness, definiteness, effectiveness, correctness, simplicity, unambiguity, feasibility, portability, and independence.

    An algorithm must have clearly specified inputs and outputs, finish in finite steps, and be well-defined, effective, correct, simple, unambiguous, feasible, portable, and independent of programming code.

    From the book: “An algorithm should have the following characteristics:”

  2. Write a note on Asymptotic notation.

    Try it, then show the answer

    Asymptotic notations express statements about time and space complexity. Big O describes the upper bound or worst case; Big Ω describes the lower bound or best case; Big Θ describes a complexity where the lower and upper bounds are equal.

    These three notations are used to represent algorithm time complexity and describe its bounds or case behaviour.

    From the book: “The following three asymptotic notations are mostly used to represent time complexity of algorithms:”

  3. What do you understand by Dynamic programming?

    Try it, then show the answer

    Dynamic programming is an algorithmic design method for problems whose solutions can be viewed as a sequence of decisions. It divides a problem into smaller overlapping sub-problems and reuses their results to obtain an optimized solution; it uses memoization.

    Previously solved sub-problem results are checked and combined to produce a better solution.

    From the book: “Dynamic programming is an algorithmic design method that can be used when the solution to a problem can be viewed as the result of a sequence of decisions.”

Part - IV — Answer the following questions (5 Marks)

  1. Explain the characteristics of an algorithm.

    Try it, then show the answer

    An algorithm is a finite set of instructions used to accomplish a particular task. It is a step-by-step procedure for solving a given problem.

    1. Input: An algorithm may be supplied with zero or more quantities as input.
    2. Output: It must produce at least one quantity as its output.
    3. Finiteness: An algorithm must terminate after a finite number of steps.
    4. Definiteness: Every operation must be clearly and precisely defined.
    5. Effectiveness: Each instruction in the algorithm must be capable of being carried out effectively.
    6. Correctness: The algorithm should be free from errors and give the expected output for valid input.
    7. Simplicity and clarity: An algorithm should be easy to implement, clear and unambiguous, so each step has only one meaning.

    Example: The chapter gives a square-finding algorithm: get input x, calculate square ← x * x, display the result, and stop.

    Thus, an algorithm must provide clear, effective, and finite instructions to solve a problem correctly.

    From the book: “An algorithm should have the following characteristics:”

  2. Discuss about Linear search algorithm.

    Try it, then show the answer

    Linear search, also called sequential search, is a method for finding a particular value in a list. It compares the search element with each list element in sequence until it is found or the list is exhausted.

    1. Order of the list: The list need not be ordered before performing a linear search.
    2. Traverse the array: Visit the array elements sequentially, beginning with the first element.
    3. Compare with the target: In each iteration, compare the target search key with the current list value.
    4. When a match is found: If the values match, display the current index and the value of the array.
    5. When values do not match: If they do not match, continue the search with the next array element.
    6. When no match is found: If the search reaches the end without a match, display that the search element was not found.
    7. Efficiency: The best case needs one comparison when the first element matches. In the worst case, the whole list is searched, requiring n comparisons; the average number is (n + 1)/2.

    Example: For the array {10, 12, 20, 25, 30}, searching for 25 finds it at index 3.

    Linear search finds an item by checking list elements one by one until a match is found or the list is exhausted.

    From the book: “This method checks the search element with each element in sequence until the desired element is found or the list is exhausted.”

Next chapterPython Variables and Operators