• Calkin-Wilf tree: The Calkin-Wilf tree is a complete binary tree. The tree is rooted at the number 1, and any rational number expressed in simplest terms as the fraction $\frac{a}{b}$ has as its two children the numbers $\frac{a}{a+b}$ and $\frac{a+b}{b}$. Every posit...
  • Stern-Brocot tree: The Stern-Brocot tree is an elegant construction to represent the set of all positive fractions. It was independently discovered by German mathematician Moritz Stern in 1858 and by French watchmaker Achille Brocot in 1861. The construction starts at ...
  • Display What: Write a program that reads a number on the keyboard without telling the user to enter a value and then displays the word $\texttt{what?!}$ on the screen and then go to a new line....
  • Integer part: Write a program that reads a real number on the keyboard without telling the user to enter a value and then displays its integer part on the screen and then go to a new line....
  • Closest value to the average: Write a program that reads 3 integers number on the keyboard without telling the user to enter the values and then displays on the screen the value of the closest integer to their average and then go to a new line....
  • ATM money withdrawal: Knowing that ATMs should withdraw the minimum number of notes for each withdrawal, write a program that reads an amount of money in LL on the keyboard without telling the user to enter the value and then displays on the screen the minumum numbers of ...
  • KM conversion: Seeing that 1 mile is equal to 1609 meters or 1760 yards, and that 1 yard is equal to 3feet and that 1 foot is equal to 12 inches, write a program that reads a real number of kilometers and converts it to miles, yards, feets (all 3 in integer) and in...
  • Binary Search Trees Variant: We consider a variant of binary search trees in which $left(n) ≤ n < right(n)$ and this for any node $n$ of the tree. Given two binary search trees $A$ and $B$, we are interested in removing from the tree $B$ all the elements that are common to ...
  • Sorting an array using two stacks: We want to sort an array of $N$ integers in decreasing order using a stack. To do this, you should use two stacks: a current stack ($\texttt{$S_1$}$) and an auxiliary stack ($\texttt{$S_2$}$) that will be used temporarily for eventual pops.  Write a...
  • Minimum and maximum values of an array using recursive function: Write a recursive function that returns the minimumand the maximum values of an array of integers.Write a main function to test your program....