Thursday, 25 February 2016

Week 6 SLog

AHHHHH!! We have are test this week and I'm super nervous!!
We just got introduced to recursion and at first glance is the most confusing thing I've ever seen.
To be quite honest not having a lot of programming experience and the combination of recursion has real distracted me. 

Thursday, 11 February 2016

Week 5 SLog


This week we learned about linked lists, another Abstract Data Type .
A Linked list is a data structure where nodes are linked together. Each of these nodes holds data and has a reference to at least it's tail/next.  Each node has a reference to its next but not its previous one. So trying to find out what is before that node would be impossible unless we introduce something called a doubly linked list. In a doubly linked list a node has a reference to its head/front and tail/back so it would be easy to iterate through a linked list no matter where you were.
Image result for doubly linked list

Another interesting point that was brought up was how do you know which head is the actual head of a linked list where the nodes are linked into a circle.
Image result for circular linked list

The answer is there is no way because you would just be linked into a continuous circle.

The way you would do this is create a class node and a class linked list that takes in nodes as a container and have each node an attribute to its head if its singly linked and if its doubly linked an extra attribute linking to its tail.

This was after writing the midterm. I think the midterm was fair, even though if we were given 10 more minutes it would've helped a lot.



Thursday, 4 February 2016

Week 4 SLog Post

This week we learned about creating classes, Queues and Stacks.

 We can create any class we like with Object Oriented programming languages like Python. Using python you can use things like lists to create Abstract Data Types like Queues and Stacks.




Image result for queue
The concept was fairly simple and not hard to grasp.
A queue is an ADT or container that is first in first out.
A queue is like a line at the grocery store.
The first person in line at the register will be the first person who is serviced and out the door.








We also learned about Stacks where a stack is an ADT or container that is first in last out.
A Stack is like a pile of papers.
If you are given a stack of papers one at a time and lay them on a table one on top of the other.
The first page that was put in if you choose to look at each paper from top to bottom will be the last one marked and the last person to get their work back.