On this page, you find an overview of how-tos and tutorials about Java.

The following articles describe various tree data structures. A tree is a hierarchical structure with a root node and its children, which in turn can have children of their own and thus form subtrees.

Red-Black Tree (Fully Explained, with Java Code)

What is a red-black tree? How do you insert, search and delete nodes? By which rules is the tree balanced? How to...

What is an AVL tree? How do you calculate a node's balance factor? How does rotation work and how is an AVL tree...

Binary Search Tree (with Java Code)

What is a binary search tree (BST)? How do you insert new elements, how do you search for them, and how do you delete...

Pathfinding or shortest path algorithms are used to find a path (or the shortest path) between two nodes within a graph.

PATH

What you'll learn

- What is the difference between "shortest path" and "pathfinding"?
- Which pathfinding algorithms are there?
- How do the most important pathfinding algorithms work (explained step by step)?
- When do you use which algorithm?
- How to determine the time complexities of the pathfinding algorithms?
- How to implement pathfinding algorithms in Java?
- What are "negative cycles" and how are they identified?

This category covers general articles about algorithms without any specific type of algorithm in mind, e.g., classifications of algorithms.

Binary Search (with Java Code)

How does binary search work? How to implement binary search in Java? What binary search functions does the JDK provide?...

Big O Notation and Time Complexity – Easily Explained

In this article, I will explain the big O notation (and the time and space complexity described with it) only using...

If you need a refresher on how the most common sorting algorithms work and how they differ, this series is for you.

What you'll learn

- What are the most common sorting methods?
- In which characteristics do they differ?
- How to sort arrays and collections in Java?
- How each sorting algorithm works (using lots of visualizations and examples).
- How to derive a sorting algorithm's time complexity, without complicated maths.
- How to implement each sorting algorithm in Java.

In this tutorial series, you will learn everything about the abstract data type "stack", how to use it, and how to implement your own stack classes in Java.

In this tutorial, you will learn everything about the abstract data type "stack", how to use it, and how to implement your own stack in Java.

How to use Java's Stack class (with an example)? Why should you stop using java.util.Stack? What are the alternatives?

In this tutorial, you will learn how to implement a stack in Java - with an ArrayDeque, an Array, a LinkedList and a Queue.

How to implement a stack based on an array in Java (without Java Collections classes)? How do you make the array grow on demand?

How to implement a stack using a linked list? What are the advantages and disadvantages? Tutorial with images and Java code examples.

In this tutorial series, you will learn everything about the abstract data type "queue", which methods it provides, how to use queues, when to use which queue implementation and how to program your own queues in Java.

In this tutorial, you will learn everything about the abstract data type "Queue", enqueue and dequeue operations, using illustrative Java examples.

How to create and use a queue in Java? What methods does the Queue interface offer? Which queues exist in the JDK? With sample code!

How to use Java's BlockingQueue interface? What methods does it provide? What are blocking, unblocking, bounded, and unbounded queues?

How to use Java's ConcurrentLinkedQueue? How does it work? What are its characteristics? When should you use it?

What is a priority queue? How does Java's PriorityQueue work? What are its characteristics? How do you use it, and how do you configure it?

How to use Java's LinkedBlockingQueue? How does it work? What are its characteristics? When should you use it?

How to use Java's ArrayBlockingQueue? How does it work? What are its characteristics? When should you use it?

How to use Java's PriorityBlockingQueue? How does it work? What are its features? When should you use it?

How to use Java's SynchronousQueue? How does it work? What are its characteristics? When should you use it?

How to use Java's LinkedTransferQueue? How does it work? What are its characteristics? When should you use it?

Which Queue implementations are available in the JDK? How do they differ? In which cases should you use which implementation?

How to implement a queue with a stack (more precisely: with two stacks)? Tutorial with illustrations and Java code examples.

How to implement a queue using a linked list? How to enqueue and dequeue elements? Tutorial with images and Java code examples.

What are data structures? A data structure is a collection of related data values and their relationships with each other. It provides operations to read or modify the data.

Java data structures are, for example, collections, maps, and sets, trees, queues, deques, and stacks.

Java Queue, Deque, and Stack: Ultimate Guide

This article explains the basic functionality of the abstract data type queue, deque, and stack, and gives a detailed...