This previous week was a very eventful and gratifying one, that's mainly because Assignment 1 was due and the finishing touches had to be made and mistakes had to be fixed. The course also introduced recursion, an important tool in coding which we will surely see again in the future.
Assignment 1 was long, it took some time to read through the given API's, client code to figure out what our classes, methods and functions had to do once we implemented them. After implementing easier classes such as Rider, Driver, Container and Dispatcher came some more difficult ones which used the former classes. Event, Monitor and Simulation were easily the most difficult classes to implement because together they formed the end goal of the assignment: to run a simulation and report the statistics. Perhaps the most frustrating aspect of the entire aasignment was figuring out what certain events were supposed to do, and then properly adding them in the correct order so that statistics would be displayed as expected. Many small changes were made throughout this part. Luckily I was able to get some much needed clarification from the instructor, helping me not only to complete the assignment on time but also to the point where I myself was able to help out fellow students with similar issues as mine.
In this past week, we were introduced to recursion. We mainly worked with some simpler functions which followed the basic recursion design, mostly working with list objects and started getting comfortable with tracing the function given an argument. Surely it will get more complicated later on and I will report as such when that time comes.
Monday, 29 February 2016
Sunday, 14 February 2016
week 5 -- class MidtermOne
Continuing on from the previous week, we discussed linked lists to a greater extent, implementing many special and other methods. On Wednesday the course held its first midterm, which I will discuss later in this post.
First, to expand on the linked lists topic, we saw API's and later implemented many different methods. Some of these included the __getitem__ and __setitem__ special methods, both of which revolved around indexes of the linked list. The former method would search through the list with a given index, if it was valid then it would return the value of the node at that index; on the other hand the latter method did a similar thing in that it searched through the list up until the given (valid) index, but instead of returning the value at that index it would replace it with a given value. Some other methods involved deleting nodes from the linked lists, many of these methods required drawing pictures so that it would be easier to visualize what was happening when a node got deleted. Many of these new methods were implemented in the week's lab section.
Moving on to the midterm, I have to say that I was quite upset after it was over. This isn't because it was very hard - on the difficulty scale I would say that it was rather fair. My biggest problem with the test was the time limitation. The test simply had too many classes and API's to implement in 50 minutes. There was no time to even think about the questions and what they were expecting of us to achieve; I made the mistake of really trying to understand what the first question was asking and by the time that I had finished it - feeling confident that what I had done was correct - half of the time allocated had already passed. This led to me and I'm assuming many other students rushing through the test and likely messing up on parts of the test which we would normally implement correctly with regular time limitations. I won't discuss any further on this test, my final thoughts stand that it was fair in difficulty but quite the opposite in terms of time limitations.
Next comes reading week, where I hope to finish most, if not all, of assignment 1, that way I'll be able to have plenty of time during the week that follows to ask any nagging questions that I had with it.
First, to expand on the linked lists topic, we saw API's and later implemented many different methods. Some of these included the __getitem__ and __setitem__ special methods, both of which revolved around indexes of the linked list. The former method would search through the list with a given index, if it was valid then it would return the value of the node at that index; on the other hand the latter method did a similar thing in that it searched through the list up until the given (valid) index, but instead of returning the value at that index it would replace it with a given value. Some other methods involved deleting nodes from the linked lists, many of these methods required drawing pictures so that it would be easier to visualize what was happening when a node got deleted. Many of these new methods were implemented in the week's lab section.
Moving on to the midterm, I have to say that I was quite upset after it was over. This isn't because it was very hard - on the difficulty scale I would say that it was rather fair. My biggest problem with the test was the time limitation. The test simply had too many classes and API's to implement in 50 minutes. There was no time to even think about the questions and what they were expecting of us to achieve; I made the mistake of really trying to understand what the first question was asking and by the time that I had finished it - feeling confident that what I had done was correct - half of the time allocated had already passed. This led to me and I'm assuming many other students rushing through the test and likely messing up on parts of the test which we would normally implement correctly with regular time limitations. I won't discuss any further on this test, my final thoughts stand that it was fair in difficulty but quite the opposite in terms of time limitations.
Next comes reading week, where I hope to finish most, if not all, of assignment 1, that way I'll be able to have plenty of time during the week that follows to ask any nagging questions that I had with it.
Saturday, 6 February 2016
Week 4 -- class LinkedList
In this most recent week of CSC148, we worked on creating API's for and implementing different classes that had similar functions such as other Python types like lists. Some of the classes covered include Stack, Sack and LinkedList.
We continued our discussion from the week before on class Stack, which would simulate a real world stack where objects were placed one on top of the other, methods to remove items from the stack, and an important feature of them in that they had no particular order, rather just the item at the top being placed followed by the next. This class was later referred to in the week's lab, where students were to implement a function that utilized the Stack class, as well as implementing a new class Queue which followed a similar design recipe as the aforementioned class.
Another concept that we spent the majority of the week discussing was linked lists. These were similar to Python lists, except that every item that would be present in a regular list appeared in this new class as nodes, each holding a value. This is very helpful in that it saves a lot of memory when many items are inside the linked list - something that was touched upon a few times during lectures is the idea of imagining that you're working with 3 billion objects, and how in these situations efficiency could be critical towards saving memory and allowing the computer to run smoothly. We discussed and later implemented methods of class LinkedListNode and LinkedList, the latter of which was a collection of nodes created from the first class; the methods themselves were very similar to those of Python list types. We were told that drawing images was easier to visualize linked lists and that it would become a good practice to do so, as we had the advantage over computer in that our brains could lay out information in front of us and look at multiple items at the same time - a simplistic explanation but hopefully it gets the point across.
Next week is the midterm, of course some stress comes with writing any test, but I feel that by going over labs, implementing some classes on my own and reading over lecture slides should get me confident and prepared for Wednesday. Stay tuned next week where I'll discuss how it went.
We continued our discussion from the week before on class Stack, which would simulate a real world stack where objects were placed one on top of the other, methods to remove items from the stack, and an important feature of them in that they had no particular order, rather just the item at the top being placed followed by the next. This class was later referred to in the week's lab, where students were to implement a function that utilized the Stack class, as well as implementing a new class Queue which followed a similar design recipe as the aforementioned class.
Another concept that we spent the majority of the week discussing was linked lists. These were similar to Python lists, except that every item that would be present in a regular list appeared in this new class as nodes, each holding a value. This is very helpful in that it saves a lot of memory when many items are inside the linked list - something that was touched upon a few times during lectures is the idea of imagining that you're working with 3 billion objects, and how in these situations efficiency could be critical towards saving memory and allowing the computer to run smoothly. We discussed and later implemented methods of class LinkedListNode and LinkedList, the latter of which was a collection of nodes created from the first class; the methods themselves were very similar to those of Python list types. We were told that drawing images was easier to visualize linked lists and that it would become a good practice to do so, as we had the advantage over computer in that our brains could lay out information in front of us and look at multiple items at the same time - a simplistic explanation but hopefully it gets the point across.
Next week is the midterm, of course some stress comes with writing any test, but I feel that by going over labs, implementing some classes on my own and reading over lecture slides should get me confident and prepared for Wednesday. Stay tuned next week where I'll discuss how it went.
Subscribe to:
Posts (Atom)