Data Structures

Learn the fundamentals of the essential Data Structures.

Trie

🎯 Objective: Learn what a Trie data structure is and how to implement it in Java. 📝 Table of Contents 1️⃣ What is Trie? Trie, pronounced as “try,” is a tree-like data structure used for efficient retrieval of information, generally in the form of words. It’s essentially a character-based tree where each node represents a […]

Trie Read More »

Graphs

🎯 Objective: Learn the fundamental concept of a Graph data structure and implement it in Java. 📝 Table of Contents 1️⃣ Introduction to Graphs Graphs are one of the most versatile data structures used in computer science. A graph consists of nodes, often called vertices, and edges that connect pairs of vertices. Unlike arrays or

Graphs Read More »

Heap

🎯 Goal: Learn what a Heap is, why it’s important, and how to implement a basic heap data structure from scratch in Java. 📝 Table of Contents 1️⃣ Introduction to Heap A Heap is a specialized tree-based data structure that satisfies the heap property. It’s essentially an array visualized as a nearly complete binary tree.

Heap Read More »

Set / HashSet

🎯 Goal: Understand what a Set is, why it’s useful, and how to build a custom HashSet in Java from scratch. 📝 Table of Contents 1️⃣ What is a Set? In computer science, a Set is an abstract data structure that stores unique elements, without any particular order. It mainly supports three operations: 2️⃣ Usage

Set / HashSet Read More »

Binary Tree

A Binary Tree is a type of tree data structure in which each node has at most two children, commonly referred to as the “left child” and the “right child.” Java Implementation Below is a Java implementation of a simple binary tree with basic functionalities such as adding nodes and traversing the tree. Binary Trees

Binary Tree Read More »

Trees

What is a Tree? A Tree is a hierarchical data structure composed of nodes connected by edges. It has a root node and zero or more subtrees, each with its own subtree structure. Unlike arrays or linked lists, trees are non-linear, offering a more diversified set of use-cases. Structure of a Tree Example: Types of

Trees Read More »

Dynamic Array

A Dynamic Array is an array data structure that automatically resizes itself when it reaches capacity. Unlike static arrays, which have a fixed size, dynamic arrays can grow or shrink as needed. Why Use Dynamic Arrays? Java Implementation Here is a simple implementation of a dynamic array in Java: Dynamic arrays are versatile and easy

Dynamic Array Read More »