Category: Java DSA

Java Program to Implement an R-Tree

Published on:

An R-Tree, short for Rectangle Tree, is a tree data structure used for storing spatial data indices in an efficient...

Read More

Java Program to Implement a KD-Tree

Published on:

A KD-Tree, short for K-dimensional tree, is a space-partitioning data structure useful for organizing points in a K-dimensional space. KD-trees...

Read More

Java Program to Implement a Quadtree

Published on:

A Quadtree is a tree data structure used to efficiently represent a two-dimensional space divided into four quadrants. It is...

Read More

Java Program to Implement LRU Cache Using LinkedList

Published on:

An LRU (Least Recently Used) cache is a type of cache in which the least recently used entries are removed...

Read More

Java Program to Implement LRU Cache Using Array

Published on:

An LRU (Least Recently Used) cache is a type of cache in which the least recently used entries are removed...

Read More

Java Program to Implement a Hash Map from Scratch

Published on:

A HashMap is a part of Java's collection since Java 1.2. It provides the basic implementation of the Map interface...

Read More

Java Program to Implement a B+ Tree

Published on:

A B+ tree is a type of self-balancing tree structure that maintains sorted data blocks in a manner that allows...

Read More

Java Program to Implement a B-Tree

Published on:

A B-tree is a self-balancing tree data structure that maintains sorted data in a way that allows searches, insertions, and...

Read More

Java Program to Implement a Suffix Tree

Published on:

A Suffix Tree is a compressed trie of all the suffixes of a given string. It is a powerful data...

Read More

Java Program to Implement a Suffix Array

Published on:

A Suffix Array is a sorted array of all the suffixes of a given string. It is a powerful data...

Read More

Java Program to Implement Segment Tree

Published on:

The Segment Tree is a versatile data structure that allows for fast query and update operations on a range of...

Read More

Java Program to Implement Union-Find Data Structure

Published on:

The Union-Find data structure, also known as the Disjoint Set data structure, provides an efficient way to handle the union...

Read More

Java Program to Implement a Circular Buffer

Published on:

A Circular Buffer is a fixed-size data structure that uses a single, continuous block of memory. It appears to be...

Read More

Java Program to Implement Deque Using LinkedList

Published on:

A Deque (short for "double-ended queue") is a type of queue allowing insertion and removal of elements from both ends....

Read More

Java Program to Implement Queue Using LinkedList

Published on:

A Queue is a First In First Out (FIFO) data structure, which ensures that the element added first is the...

Read More

Java Program to Implement Stack Using LinkedList

Published on:

A Stack is a Last In First Out (LIFO) data structure. The primary operations associated with a stack are push...

Read More

Java Program to Implement Stack Using Array

Published on:

A Stack is a linear data structure that follows the Last In First Out (LIFO) principle, meaning the last element...

Read More

Java Program to Implement a Priority Queue Using Heap

Published on:

A Priority Queue is an advanced data structure that stores elements based on their priority. It allows for constant-time retrieval...

Read More

Java Program to Implement Trie Data Structure

Published on:

A Trie, also known as a prefix tree, is a tree-like data structure that is used to store a dynamic...

Read More

Java Program to Find Minimum Spanning Tree (Kruskal’s Algorithm)

Published on:

The Minimum Spanning Tree (MST) of a graph represents a tree with the minimum possible sum of edge weights that...

Read More

Java Program to Find Shortest Path in a Graph (Dijkstra’s Algorithm)

Published on:

Dijkstra's Algorithm is a classic graph algorithm that is used to find the shortest path from a starting node to...

Read More

Java Program to Perform Depth-First Search in a Graph

Published on:

Depth-First Search (DFS) is another fundamental graph traversal algorithm, which explores as far as possible along each branch before backtracking....

Read More

Java Program to Perform Breadth-First Search in a Graph

Published on:

Breadth-First Search (BFS) is one of the simplest algorithms for searching a graph. It traverses the graph layer by layer,...

Read More

Java Program to Implement Graph Using Adjacency List

Published on:

A Graph is a non-linear data structure that represents entities (often called nodes or vertices) and the connections (edges) between...

Read More

Java Program to Implement Graph Using Adjacency Matrix

Published on:

A Graph is a non-linear data structure that consists of nodes (or vertices) and edges that connect these nodes. One...

Read More