Graphs: Depth First Traversal (C#)

Continuing where we left off with Graphs, we saw that Dijkstra’s Shortest Path was an example of a breadth first search traversal. In this tutorial, we will implement a depth first traversal (also called DFS, depth first search). What is depth first searching? The whole idea of DFS algorithm is to go as far as…

Graphs and Dijkstra’s Algorithm (C#)

Graph Data structure A graph is an abstract data structure representation of connected nodes (also called vertices) by various edges (or the link/distance between nodes). Theres two kinds of graphs, directed and undirected. Directed means that each set of nodes are connected by edges, where the edges have a direction associated with them. For example,…

Priority Queue Tutorial (C#, C++, Java)

What is a Priority Queue? An ADT whose primary operations of insert of records, and deletion of the greatest (or, in an alternative implementation, the least) valued record. Most often implemented using the heap data structure. The name comes from a common application where the records being stored represent tasks, with the ordering values based…

The Heap Data Structure (C++, Java, C#)

Review of The Heap Data Structure I covered heapsort a while ago, and that used a heap as well. A heap is tree based abstract data type that works by maintaining the heap property. Basically, there’s 2 common heap properties: min-heap, and max-heap. Min-heap says that the root of the heap must be the lowest…

Hash Tables tutorial (C#, C++, Java)

Hash Tables are a type of abstract data structure that are used to implement a type of associative array. That is, an array that stores data using key and value components like so: (Key, Value). Much like a dictionary or a map, hash tables store some type of data that has a key element used…

Red-Black Tree in C#

Red-Black Trees are another self balancing binary search tree data structure.  Much like the AVL Tree which is also self balancing and has the same time complexity O(log n) for best, average & worst case. Red-Black Trees are a bit more efficient in insertion and deletion in that they require less work to be done,…