Data Structures Posts

4 posts in this category

Bitboard Tic Tac Toe
Bitboard is a widely-used technique in many computer chess programs for efficiently representing and extracting information on the chessboard. It seems to be simultaneously invented by the computer…
Data Structures
Graph Represent
There are two ways to represent a graph data structure, each come with its own pros and cons. An adjacency matrix is a square matrix, each element in the matrix indicate whether pairs of vertices are…
Data Structures
Binary Search Tree Delete node
Algorithm to delete a node from a BST: Find the node to delete Find the deepest right most (DRM) node of the tree Replace the node to delete with the DRM Continue find and delete the DRM in the tree…
Data Structures
Binary Tree In-order Traversal with Stack
This one is a bit more compex than the pre-order (in term of using stack). Algorithm: Create an empty stack Create a temporary reference called curr, set it as root Repeat while curr still not null…
Data Structures