{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Recursion"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Build function <font color=blue>squareRoot</font> which gets as input a number <b>N</b> larger than 1 and returns the square root of <b>N</b>. Do I have to tell you that you may not use the srqt function? \n",
    "<br>Write your program in such a way that it displays every step. Try it only with perfect squares (4,9,16,25...) otherwise you might have rounding problems and never end.\n",
    "\n",
    "<font color=PURPLE><b>Strategy:</b> the function sets two limits, which at the beginning are <b>lower</b>=0 and <b>upper</b>=<b>N</b>. Then it picks a number between these two limits (for example the number in the middle) and calculates its square. If the square is exactly <b>N</b>, very well. If it is larger than <b>N</b>, it will pick another number between <b>lower</b> and <b>X</b> and repeat. If it is smaller than <b>N</b>, it will pick a number between <b>X</b> and <b>upper</b>. Obviously you must use recursion here, building an appropriate function which will be called recursively with parameters <b>N</b>, <b>lower</b> and <b>upper</b>."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Sorting algorithm"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Build a function which receives as input a list of numbers and returns a list with the same elements but in order. \n",
    "\n",
    "Do not use the .sort() method. Do not copy my algorithms nor search the web for it: sorting algorithms can be tough and this exercise will help you understand the difficulties that you have when trying to sort and open your mind towards the algorithms that I am going to explain next time. Take pencil and paper and do it manually with a list of 10 elements, then write your program."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
