Sunday, 15 February 2015

Week #6: Stacks and Queues


This week we learned about Stacks. Stacks are a way of organizing information. When a Stack takes in new inputs it adds it to the Stack, the Stack works by piling up the inputs and the user can check if it is empty, what the top item is, and pop off the input on top (the last input entered). We also learned about Queues which are similar to Stacks in the way they store information but rather than the first item put in being the last item taken out (Stacks), for Queues the first item put in will be the first item taken out.

Friday, 6 February 2015

Week #5: Recursion

Recursion is when a function calls itself.It uses the recurring patterns within the input to shorten the amount of code needed. By using recursion it allows the user to evaluate arbitrarily large inputs with several nested inputs quickly. I found that the examples using turtle were very helpful to visualize how recursion works and what exactly it does.