Wednesday, 30 March 2016

Week 11: A final Reflection on this course from Week 3 Perspective

As we approach the end of this semester, I can reflect back to CSC148 more thoroughly, on the course overall and reflect upon and add to my initial views of this course. I undoubtedly enjoyed this course and would not hesitate to say that it was my favourite course of this semester. My earlier impression of this course was that it mainly focuses on building programming techniques and developing good habits of writing code (docstrings). However, now, I realized it is not only the aforementioned, but its primary focus is on how to make your program more efficient using recursion, using abstract data types to collect data in more efficient manner so that it takes less memory (LinkedLists instead of lists and other ADT's like Trees, Binary Trees etc), using inheritance to avoid duplicate code and along with other programming techniques. Overall, it was about learning programming principles and applying them to develop efficient programs that can be applied in almost any programming language.

Even though I learned a lot more about Python this semester, it was obvious that the course primarily used the language as an instrument to showcase, demonstrate, and teach us the more advanced programming techniques which could be applied any other languages as well. In CSC108 last semester, we learned plenty about how to used various ways to utilize the Python language while learning some of the basic programming ideas and principles. In CSC148, we were pushed to learn more about computer science instead of computer programming and apply the concepts learned from this class and CSC108.

I have no doubts that my programming skills and understanding have been greatly improved by taking this class. Moreover, I have gained much more confidence about my understanding about computer science and its theories and what actually happens behind that computer code. The experience I have received from this course will be useful for any future programming courses or jobs. This course will be the foundation upon which I build my computer science education.

Monday, 21 March 2016

Week 10: Assignment 2

This Thursday is the due date for our second assignment in this course. Having the same partner for this assignment as last one, we have quite an understanding of how we both will be performing and what aspects we both need to improve by observing the mistakes done on the previous assignment. This time, we are approaching this assignment from a bit different perspective. We both came on a mutual decision of working on the assignment individually so that we both work on all the puzzles and search tools and at the end, compare the code and run time and decide whose is better and use that one. By this, we both get to work on the whole assignment while at the same time using the better version of the code. Currently, being done till the word ladder puzzle, I feel this assignment is really challenging and really making us think on how to get it to work. Although it is challenging, it is fun and rewarding when the code works and that is what makes me enthusiastic on this project.

This week in class, we were introduced to the concept of big O and the whole idea of run time. I had some previous understanding of this concept from csc 165 so I knew what was headed. As we approach the end of this class and the semester, I feel this course really helped me in understand what actually computer science is and what field I am really entering since before this class, all the understand of CS I had was that it is something related to coding but know, how it is not about just writing the code, but writing efficient code

Thursday, 17 March 2016

Week 9: Here comes the evaluations!!!

What a busy week! We had our second midterm on Wednesday and also had an assignment due the following Thursday. All the course content is starting to come together. The earlier weeks of class design are more important now as the length and complexity of code is now increasing. While working on the assignment two, I noticed that it takes longer to write less lines of code but that code does a lot more. Along with the class design, the concepts we have been learning this week in class would not have been possible without the earlier recursion classes. Looking over a binary search tree would be a lot messier if done without recursion. 

Speaking of writing less but doing more, the midterm this week was lot less writing compared to the first one. With less writing came a lot more thinking. Every question required thinking of different cases and all but one of them had some recursive element in it. Redoing the labs and looking over previous midterms gave me a good sense of what to expect so there were no surprises for me on the exam. I was expecting there to be some form of tracing but it did not show up. I thought the midterm was extremely fair and covered the most important course concepts. I look forward to the final concepts of the course and finishing off assignment two.

Wednesday, 9 March 2016

Week 8: Absorbing the CS in me

As we progress in the course, we are now starting to learn new ways to organize data and objects in python in more efficient and organized manner. This week, we were introduced the data structure of Binary Tree. A binary tree has an arity of 2. It has a value in it's own node, where it has a left ad a right child and the tree continues. We implemented this tree with __eq_, __str__, and __repr__ while making a functionality of determining if  a node exists or not with a specific value in it. We even went and created arithmetic expression trees where there are arithmetic symbols '+', '-', '*', or '/' and that is applied on the values of the node and hence used to solve the tree. This way of organizing objects was quite interesting to me where I was witnessing that there are so many ways of collecting data in an efficient manner.

Not only implementing the binary tree, we also went in depth of how to get the data in the binary trees in different manner 'traversal'. In traversal, there were three ways of fetching objects from the tree. First being the 'inorder' which would get the left node first, then the parent node, and then finally the right node. This would be done recursively until reached the end of the tree. Second method was called 'preorder' where the order was a bit different. Here, first the parent node would be fetched, then the left node and finally the right one. Finally, the third method was known as 'postorder' where the objects were fetched in left most node, then right most node and finally the parent of those nodes order. Doing all this really made me feel like a CS student (one who is smart) and where computer science is no more just about coding and more about the science behind the code and writing the code in an efficient manner.

Finally, we also went over binary search trees which the same as binary trees but BST (binary search trees) with n nodes may have height 'int(lg n) + 1' as the best case (a more balanced tree) If a BST node has a left child, the left child's value is always smaller than the node's right child and vice versa. Moreover, we also learned to implement BST with an insert method which would place the object in the tree in that very order. Overall, this week made me feel like a true CS student who is now officially dealing with subject which are more concerned about efficiency than the code (high school)

Wednesday, 2 March 2016

Week 7: The Interesting Stuff

As enter the week 7, concepts get more interesting to pay attention to. Before, until week 5, it felt to me like I have been learning the same things with a few modifications to them even though others were like this is all new but now, since week 6, all of sudden the concepts of recursions and trees makes me feel that I have gained so much from this course in such short amount of time. More than the further knowledge gained about the object oriented programming approach, I feel a lot more in control over how I want to design my program by choosing the most efficient approach with proper coding etiquette (docstrings and comments).

I found myself figuring out all the new possibilities with recursion. The example of a list of lists of unknown depth was really interesting. Without recursion, I can't really seem to figure out a way to search through the elements or sum all the elements. Now with just a few lines of code, I can do way more operations instead of any mess of nested for loops. Recursion looks a lot cleaner and using the method of solving the base case (depth of 0) and then looking at it for each subsequent depth case made creating recursive code a breeze.

Trees are structures of data where there is a starting point or node and directed edges pointing from that node towards other nodes which in turn point to other nodes, and so on. As a result, they are similar to linked lists as each node pints to a list of other notes who each point to a list of nodes, and so on for each node. Recursion is very useful because it allows us to access data from a collection of elements when each of those elements can have elements of their own which can have elements of their own, and so on easily by simply calling a function within itself. By using these recursive functions on trees, it becomes possible to determine which nodes are leaves and how tall the tree is.

I can totally see recursion go a long way and even in the upcoming assignment two posted this week where it is obvious that recursive approach would be used for searching all the future moves for solving the puzzles and also to confirm if there exists a solution with the current situation or not. Learning recursion has changed the way I approach computer science problems and I'm really excited to use it in my further projects.