Sunday, 1 November 2015

Low Level Programming Session Summary 6, 1st November

Low Level Programming Session Summary

1st November

This session we recapped what we did last lesson and talked about our assignment. I feel that perhaps it will be a little difficult for me. Many of us, including myself, have only been coding for a year. We have been asked to demonstrate various coding techniques, however we have only just discovered what casting is as well as how to deal with virtual functions and OOP design. We have been used to single classes thus far and I am certainly having trouble with Enumerators. It will prove to be a challenging assignment for many of us I fear.

Still, we discussed containers again. We talked about the vector and how that works. It is essentially an array of numbers, much like an array. A vector however forward declares space for itself to expand, thus it can expand to accommodate more space than originally declared. It uses pointers to tell the vector where each set of data is. It stores a number of sections of data in one pointer, then another section in another and vice versa. 

You can use an iterator to cycle through each member of an array and one can even have constant iterators which are usually better unless you're going to change the number of members in an array. Overall, vectors are a good alternative to arrays but are not good at randomly picking numbers from the array. To apply this to the coursework, if one was to create a deck of cards or letters array, one would be better off using an array rather than a vector.

Predicates are often used in algorithms and are simple functions. They take a single parameter and return a boolean, finding out if it is true or false. It usually takes an iterator and dereferences it for use in the function. It doesn't care what item it is, it will query the state of that object.

We also learned about linked lists which are a series of interlinked nodes. It is a bit like an array of single integers, but each integer also has a pointer to the next, creating a chain of pointers. If one integer is deleted then the list can repair itself by rearranging the pointers to the next item in the list. 

A Deque is essentially a vector which expands in both directions to accommodate an array. It is extremely rare that one is used and it will be unlikely that one will be used. Still, they are efficient but have their own drawbacks in that they are not continuous and take up more memory.

Overall this session was again helpful, however I feel that learning all of these concepts is not enough. I want practice coding all of these things and granted we have limited time in the session. Some sort of activity I could do out of session would be nice as well. I am concerned with the assignment difficulty as well and though I think I see how I am able to do it, I am certain it will prove difficult as these things often have.

No comments:

Post a Comment