Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
25 views1 page

Programming Exercises for Students

The document outlines 10 programming exercises divided into 5 sections - Sets, Functions and Relations, Recurrence Relations, Trees. The exercises involve writing programs to determine if two arrays represent the same set, represent a set given an array, find the inverse and composition of relations, calculate compound interest using iterative and recursive solutions, and perform pre-order, post-order and in-order tree traversals.

Uploaded by

tempyeckle
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views1 page

Programming Exercises for Students

The document outlines 10 programming exercises divided into 5 sections - Sets, Functions and Relations, Recurrence Relations, Trees. The exercises involve writing programs to determine if two arrays represent the same set, represent a set given an array, find the inverse and composition of relations, calculate compound interest using iterative and recursive solutions, and perform pre-order, post-order and in-order tree traversals.

Uploaded by

tempyeckle
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Project Problems

Set Exercises
1 1, 3, 5, 7
2 2, 4, 6, 8
3 3,6,9,10

Sets
1. Write a program to determine whether X = Y given arrays representing X and Y.

2. Assuming a universe represented as an arrays, write a program to represent the set X ,


given the arrays representing X

Function and Relations


3. Assume that a sequence from [1,,n] to the real numbers is represented as an array A,
indexed from 1 to n. Write a program that finds the inverse of a relation

4. Assuming the same as previous exercise, write a program that finds the composition R o
S of relations R and S

Recurrence Relations
5. Write a program that prints the amount accumulated yearly if a person invests n dollars
at p percent annual interest compounded m times yearly. Write the program using two
versions: (a) Using iterative solution (b) Recursive solution
6. Write a program that prints the amount accumulated yearly if a person invests n dollars
at p percent compound annually. Write the program using two versions: (a) Using
iterative solution (b) Recursive solution

Trees
7. Write a program that tests if a graph is a tree.
8. Implement pre-order tree traversals as program.
9. Implement post-order tree traversals as program
10. Implement in-order tree traversals as program

You might also like