Fundamentals of Algorithms Study Notes

  1. What is an algorithm?

    a) A finite set of undefined instructions

    b) A finite set of well-defined instructions used to solve a problem

    c) A random sequence of computational steps

    d) None of the above

  2. Which of the following characteristics is NOT part of a good algorithm?

    a) Effectiveness

    b) Finiteness

    c) Ambiguity

    d) Definiteness

  3. **What does the notation *X = Y* mean?**

    a) Assign value of X to Y

    b) Assign value of Y to X

    c) Get value of Y from X

    d) None of the above

  4. Identify the control structure used when the instructions are executed in order.

    a) Selection

    b) Iteration

    c) Sequence

    d) None of the above

  5. What is the general form of a WHILE loop?

    a) WHILE (condition) DO

    b) IF (condition) THEN

    c) FOR I ← start TO end DO

    d) REPEAT

  6. In a selection control structure, what does an IF statement do?

    a) Executes instructions in order

    b) Chooses between two or more paths

    c) Repeats instructions

    d) None of the above

  7. **What does the notation *X ← X + Y* indicate?**

    a) Assign value Y to X

    b) Increment X by Y

    c) Add Y to X's current value

    d) None of the above

  8. Which of the following is an example of an algorithm?

    a) Algorithm to find the sum of two numbers

    b) Algorithm to create a graph

    c) Algorithm to sort a list of names

    d) All of the above