Posts tagged with “C++”

Important: Pick One Language for the Coding Interview

I wanted to clarify the programming language requirement for the interview. I was under the impression that I needed C++ or Java to do the interview, and that in some cases C would suffice. But I also felt the need to know Python, since it is also widely used. A further reason for getting deep into…

Read more

How to Run Valgrind in CLion, for C and C++ Programs

I needed this for myself, and Googled around but didn’t find anything satisfactory, but now after a little work, I’m all set with Valgrind. Wouldn’t you love this on your toolbar? Well, you can have it, friend. Read on. 1. Add this Bash script I have it in my current project,…

Read more

So Much Sorting

I put on my sorting hat and watched many, many videos on sorting. The videos covered: bubble sort selection sort insertion sort heap sort merge sort quicksort counting sort radix sort There are several more sorting algorithms I could have gone into, but I had to stop somewhere. I’d like to…

Read more

Binary Trees

I’ve moved on to trees, and I have many trees to cover. The types of trees I’m studying: binary search tree: BST red/black tree splay trees AVL trees B-Trees: 2-3 (type of B-tree) Search Trees N-ary trees Tries Heap Binary Heap Disjoint Sets Priority Queue Here are a few code samples…

Read more

In the Queue

I’m working on queues today. I’m implementing a queue using a fixed-size array, and also using a linked list. These are the four operations each will support: enqueue(value) - adds item at end of available storage dequeue() - returns value and removes least recently added…

Read more

Linked Lists Complete

I ended up with 2 implementations of linked lists in C, an object-oriented approach in C++ (with templates!), and followed up with a smaller OO implementation in Python. I’m pretty proud of these. The C and C++ versions have test suites, so I’m very confident with the code. For the…

Read more

All Up In Linked Lists

Yesterday I started on linked lists, and this one looks like it will go 2-3 days. I started off with a nice C implementation, with many functions for manipulating a list. I was pretty proud, then I started looking around and the other implementations I’m seeing are different from mine. Not…

Read more

Hand-Crafted Vectors

I’ve been continuing my studies in computer science by implementing a vector (automatically resizing array) without using arrays. I started with C, and wanted to get more experience with allocating/freeing memory and practicing with pointers on an array of integers. I don’t use the []…

Read more

Reading the Google C++ Style Guide

I finished reading C++ Primer Plus. Man, that was a big book. But I feel infused with knowledge! I started watching some C++ videos, and how Google uses C++, and ran across this video: The speaker, Titus Winters, is on the team that determines appropriate the coding style that all 4,000 C++…

Read more

Collapsing Code Using DeMorgan's Laws

I ran across this Boolean logic law back in 2011, and it’s stuck with me ever since. De Morgan’s Laws deal with taking multiple Boolean expressions and simplifying them. The transformations don’t seem correct at first glance. It feels like there are logic holes, but they are…

Read more

Learning C++

I finished the C book, and practiced a bit. Now it’s time to crack open C++ Primer Plus. Weighing in at 3.8 pounds (1.7 kg) and 1,365 pages (excluding index), it’s a beast. But I want to learn this thing, and learn it well. I know that I don’t need to know everything in this book…

Read more