Friday 24 January 2014

Week 2 - Abstract Data Types


This week I have learned something which I haven't quite heard of before. It's the abstract data types. This was quite interesting and was not something as complicated as the name sounds! I actually enjoyed attending the lectures.

This week's lab was very much fun as well. I particularly enjoyed understanding the reason behind the increasing run-times of different methods of the queue ADT, as the number of items in the in the queue is increased.

However, I did find solving the puzzle which Dan showed us in class quite difficult, particularly using a stack. The balanced parenthesis problem  also was very challenging to solve. To be honest, I am still not confident of being able to solve these problems by my own.

I believe the above challenges can be overcome by constant practice and dedication. One way to do this might be to think of scenarios in the real-world and try to solve problems using these ADTs. This can be of anything: for example, designing a program which will keep record of all the sales in a store for a day. Here, a dictionary can be used to record the details of each sale, which can then be stored in a queue ADT; so that it can later be reviewed starting from the very first sale, till the last. This example is just one of many one could potentially come up with. (I think it would be great if Dan posted some more problems for us to solve using these ADTs.)

Actually I had some time after finishing this week's exercise, so I myself designed some small programs using stacks and queues to enhance my skills in using these abstract data types.

 I would really like to know what others have to say about my thoughts and approach. So I am really expecting others to share their views and/or suggestions.

Sunday 12 January 2014

Week 1 - Classes and Objects


In the first week of lectures we learned about object-oriented programming and its advantages. We learned to appreciate that this style of programming can be used to meet real-world challenges more accurately and conveniently.

One important thing I realized while using this style of programming is that I very often tend to miss out important methods (or tasks) required to be included in a class. That is, I begin to think I am done before I am actually done.

I believe the key to avoiding this difficulty is to first think of the actual scenario of the object in the real-world. That is, we need to first jot down the tasks that the object may be required to do to achieve full functionality. We will also be have to be careful about deciding what to be and what not be included as arguments for the constructor. Once we are done with these, we are ready to start writing codes for making the class.

One thing I really enjoyed was making the Point and the Rational classes. I love Mathematics, so making such a class was really fun. I was actually being ahead of Dan while defining methods in the lecture! (However, I did miss out a method or two.)

Overall, the first week went well for me. Nothing seemed too complex, as long as I did the readings carefully.

However, it would have been more fun and interactive had clickers been used in the lectures in this course, like it was in CSC108. I believe that enriched my learning experience a lot!