A Brief Business Distraction

I have to take care of some things for my business for a couple of days. You do know I run my own startup full-time, right? I was in the middle of building my flash cards site. It’s almost done. I have all the card management working, so I now just need to do the actual memorization/testing…

Read more

Working on a Quick Flash Card Site

I’ve been studying for quite a while now, and even though I coded up data structures like crazy, I feel the knowledge fading. What I want is two special sets of flash cards: - general CS knowledge - vocabulary - definitions of processes - powers of 2 - design patterns - Big-O of…

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

Hamming Code

This is a bit of a departure from data structures (which I’m in the middle of), but I wanted to cover Hamming Code and Error Checking since I had just covered bitwise operations. I’m really impressed with this marvel. If you don’t know, Hamming Code is a special way of laying out…

Read more

Binary Search

I thought binary search was just good for sorted arrays, but this article on TopCoder was really good. It got me thinking of all sorts of ways to avoid a linear search when you know a search space has an inflection point that can be tested with a predicate. Here’s my humble implementations of…

Read more

Bit Manipulation

Bitwise operations are a very weak spot for me. ANDing, ORing, and XORing (huh?) bits hasn’t really been anything I can say I’ve needed to do, except for one company that used bitfields to save space. And << and >> have had little practical use for me. By the end of the day,…

Read more

Spending a Couple Days on Hashing Functions

In my study of data structures, I’ve made it to hash tables. I’m spending a little extra time on this one, because there is some math and inherent gotchas in hashing and I want to fully understand. I may not get all the math, but I’ve got the important bits. In addition, hash…

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