Data Structure Arcade

Wordle

Data Structure: Set

This is a recreation of the popular online game "Wordle" which focuses on the O(1) searching feature of the Hash Set. Players can guess any word and check if it is in a dictionary of over 10,000 words in constant time via this Data Structure.

Play >

Tic-Tac-Toe

Data Structure: 2D Array

This is a recreation of the popular game Tic-Tac-Toe (or XO) using Nested Arrays. Each tile on a tic-tac-toe board can be viewed as belonging to a specific row or column, and one can access particular elements in 2D arrays using array[row][column].

Play >

Snake

Data Structure: Doubly Linked List

This is a recreation of the popular online game "Snake" which implements a doubly linked list. The advantage to linked lists in general is that they take O(1) time to insert new elements, unlike arrays which take O(n). Hence, each time the snake eats an apple, it will instantly grow. In addition, it also takes advantage of the "previous" pointer in doubly linked lists. When the snake moves, each node of the its body is reassigned to the value of its previous pointer.

Play >

Hero Guesser

Data Structure: Binary Tree

This is a recreation of the popular online game "Akinator" which implements a binary tree. This binary tree is similar to a binary search tree/heap in that all the nodes hold one common property: everything to the right of a node assume that the current node is true and those nodes to the left assume false. It is a sort of "boolean BST". When the users press yes, we traverse to the right of the tree and we traverse left otherwise. The game is stopped once we hit a leaf node, meaning we found the character with the user's specifications. The O(logn) time for searching is benefitial because finding the character with the user's specifications in an array would otherwise take O(n).

Play >