Java

General Tree Data Structure Example: Printing levels of the Tic-tac-toe Game Tree

One of the General Tree Data Structure example of application is to create game trees. In this post, you will learn how to print some levels of the game tree for the popular game Tic-tac-toe. Tic-Tac-Toe The Tic-tac-toe game consists of a 3×3 board. One player place X’s on the board and the other one …

General Tree Data Structure Example: Printing levels of the Tic-tac-toe Game Tree Read More »

Graph Data Structure applications: solving a real-world problem

The graph data structure can be used to solve many real-world problems. In this post, you will see one of the graph data structure applications. To solve the problem I’m showing you here, you can use the implementation for the undirected simple graph data structure. Graph ADT operations When you want to use a data …

Graph Data Structure applications: solving a real-world problem Read More »

Stack data structure implementation in Java (using linked lists)

The Stack data structure implementation is studied in most Computer Science courses on Data Structure and Algorithms. In this post, you will learn one implementation of this important data structure. What is a Stack? A stack is a linear data structure that follows the Last In First Out (LIFO) principle. This means that the last …

Stack data structure implementation in Java (using linked lists) Read More »

Queue data structure implementation in Java (using linked lists)

The Queue data structure implementation is studied in most Computer Science courses on Data Structure and Algorithms. In this post, you will learn one implementation of this important data structure. One of my favourite books to study data structure is Introduction to Algorithms by Cormen. What is a Queue A queue is a linear data …

Queue data structure implementation in Java (using linked lists) Read More »