Problems

You are advised to design recursive and iterative solutions for the following sample problems. You are also encouraged to write the Modular programs (with functions) in C language or Python language for these problems:

  1. Write a program to carry out arithmetic operations (addition, subtraction, multiplication, division) on two numbers.

  2. Write a program to find maximum of two numbers.

  3. Design an algorithm and Write a program to add n numbers provided in a list. Also find a recursive solution. Clearly specify the basis and recursion steps.

  4. Design an algorithm and Write a program to compute factorial of a number. Also find a recursive solution. Also find a recursive solution. Clearly specify the basis and recursion steps.

  5. Design an algorithm and Write a program to find maximum of a list of n numbers provided in a list. Also find a recursive solution. Clearly specify the basis and recursion steps.

  6. Design an algorithm and Write a program to reverse a string of n characters. Also find a recursive solution. Clearly specify the basis and recursion steps.

  7. Design an algorithm and Write a program to find sub-string in a given string. E.g. find "Research" in the string "Institute of Infrastructure Technology Research And Management"

  8. Design an algorithm and Write a program to find nth element in the Fibonacci sequence. Also find a recursive solution. Clearly specify the basis and recursion steps.

  9. Design an algorithm and Write a program to find sum, average and standard deviation of a list of n numbers. Also find a recursive solution. Clearly specify the basis and recursion steps.

  10. Design an algorithm and Write a program to check whether a string of n characters is palindrome or not. Also find a recursive solution. Clearly specify the basis and recursion steps.

  11. Design an algorithm and Write a program to carry out following vector operations:

    1. element wise addition of two vectors

    2. element wise subtraction of one vector from the other

    3. dot product of two vectors

Also find a recursive solution. Clearly specify the basis and recursion steps.

  1. Design an algorithm and Write a program to carry out following matrix operations:

    1. find transpose of a matrix

    2. addition of two matrices

    3. subtraction of two matrices

    4. multiplication of two matrices

  2. Design an algorithm and Write a program to check whether the given integer is

    1. a prime number

    2. an Armstrong number

  3. Design an algorithm and Write a program to sort a list of n numbers.

  4. Design an algorithm and Write a program to merge two lists.

  5. Design an algorithm and Write a program to merge two ordered lists. Also find a recursive solution. Clearly specify the basis and recursion steps.

  6. Write a program to perform following operations on data files:

    1. read from data file.

    2. write to data file.

    3. append contents of a file to the other file

    4. copy contents of one file to the other file