Dijkstra's Algorithm in Python 3

Greed is good. And Dijkstra’s algorithm is greedy. Dijkstra’s algorithm not only calculates the shortest (lowest weight) path on a graph from source vertex S to destination V, but also calculates the shortest path from S to every other vertex. My implementation in Python doesn’t…

Read more

Graphs and Dynamic Programming

I’ve been learning graphs and dynamic programming somewhat interleaved. Dynamic programming tends to help solve graph problems because: Every problem solvable by dynamic programming can be represented in a DAG. A couple of things I discovered in my experiments: Using a queue for graph…

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

My Summer Reading List

Technically, I started reading in April, but look at that stack! I’m not spending too much time reading on a daily basis right now. I want to get past the learning phase, then once I’ve had enough exposure to the main requirements for a coding interview, I’ll spend half the day…

Read more

Splay Trees: The Pretty Much Perfect Binary Search Tree

Splay trees are very simple as far as structure. A splay tree a binary search tree, so each node has a key, maybe a left child, and maybe a right child. There’s no subtree height, ranking info, or anything else. It’s pretty simple. It’s the splay algorithm that gives the splay…

Read more

An Astounding Example of Efficiency with B-Trees

I’ve been sitting at self-balancing binary and other k-ary trees for a while, and I should be moving on to sorting algorithms tomorrow. But I was really amazed by an example of B-Tree usage in quick data accesses, that minimizes disk accesses in a smart way. I wanted to share it. From…

Read more

Working to Become a Unix/Linux Master Plumber

I’ve been reading an old but great book, The Unix Programming Environment (1984), by Brian Kernighan (of K&R C fame) and Rob Pike. I think it’s no longer in print, because the price on Amazon for a new paperback is over $50. On Half.com you can find it for less than $10. The book…

Read more

UX Makeover: My Terrible Pricing Page

I can call it terrible, because I designed it. – me The Just Really Bad Page Last week I spent some time overhauling the pricing page on TalkToTheManager. We had put out a new pricing page with the advent of text message surveys, and after about 2 months I revisited the pricing page and,…

Read more

Priority Queues: Heap Implementation

I made a departure after studying binary search trees to visit priority queues and heaps. I had planned to do this one later, but it kept coming up in lectures. I really like heaps. They are space and operation efficient, easy to understand and code, and make sorting easy. What’s not to…

Read more