Good morning. It is a relatively cold Saturday in the Twin Cities. For some reason, this winter season has been warmer than usual with very little snow coverage. For example, today the high temperature will be around the freezing point. Some people (like me) like it while others hate it. There is no way to please everyone at once.
In an attempt to review in a systematic way some features of C++ I will be experimenting with polymorphism. In programming languages and type theory, polymorphism is the provision of a single interface to entities of different types or the use of a single symbol to represent multiple different types. To read more about it you may refer here.
Continue reading “C++ Tidbits – Polymorphism”
I am about to complete a course on Neural Networks and Deep Learning. I am amazed at how one gets absorbed into the subject and language (in this case Python). Lately when I am working with C, C++, Java or Python I occasionally use a syntax from a different language.
In this post I will be covering / reviewing Inheritance using C++. Many years ago when I wanted to review C I would pull from my bookshelf the book “C Programming Language” by Brian Kernighan and Dennis Ritchie. During the years I have owned several copies. A few minutes ago I tried to locate my latest copy, but it seems that it grew legs and walked away. For C++ I have … (I guess I have also misplaced it) a book by Bjarne Stroustrup. Given the fact that I want a quick refresher, decided to go over an Advanced C++ Programming course by Mike McMillan. For this post (and a few more that I will write in the next few days) I am using this course as a guide and will be coding C++ on Visual Studio 2017 from Microsoft. Continue reading “C++ Tidbits – Inheritance”
While programming in most (never say all) programming languages and platforms one often runs into the need to swap the values of two variables. The following code in Java illustrates a first attempt to swap two integers: Continue reading “Swap Values”
Earlier this week, I received an email message from HackerRank suggesting a C++ challenge. Finally I was able to work on it. This past week I was busy with work. Continue reading “Lower Bound – STL”
I received an email inviting me to solve the Classes and Objects challenge at HackerRank. If interested please take a look at the requirements and give it a try before reading my solution.
The requirements call for the design of a class with two methods. One of them reads grades from standard input while the other computes the total score for a set of five grades. Continue reading “Classes and Objects”
I received an email from HackerRank inviting me to solve the Class challenge. I like the reminder feature because I do not have to think about challenges during the workday. They just pop into my in box and I just have to pick a time to solve them. Continue reading “Class”
I received a message from HackerRank to solve the Vector-Sort challenge. The requirements call to instantiate a vector of the desired size. Populate and then sort the vector. Once sorted the values in the vector need to be displayed. Continue reading “Vector-Sort”
I took a look at the StringStream HackerRank challenge. There are two items that one needs to deal with. The first is to parse the coma separated string of integers after it has been assigned to a string stream as suggested by the challenge. Of course one could solve this challenge just parsing the string directly. The second task is to allocate a vector in which to return the integers. At first I just allocated an empty array which I resized each time a new integer had to be inserted. In my final approach I just determined the number of integers by counting the ‘,’s in the string. Continue reading “StringStream”
I believe that I am finished with the implementation and testing of the DoubleLinkList class using templates in C++. At this point I should be able to start using the class. Hope to get to that sometime this weekend.
Following is the screen capture of a console displayed on my Windows
machine using Visual Studio 2013 while running the test code for double linked lists: Continue reading “Linked List – Part VI”
I continue to design and implement the DoubleLinkList class using C++. If interested, please take a look at the previous post on this series: Linked List – Part IV
Following is a screen capture of the Windows console with output from Continue reading “Linked Lists – Part V”