Skip to content

Immutable Stack and Queue implementation in Java Programming Language.

Notifications You must be signed in to change notification settings

czetsuya/Java-Immutable-Stack-and-Queue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Immutable Stack and Queue In Java

Immutable Stack and Queue implementation in Java Programming Language.

A Stack is a Last In First Out (LIFO) data structure. It supports two basic operations called push and pop. The push operation adds an element at the top of the stack, and the pop operation removes an element from the top of the stack.

Example stack of integers: 1, 2, 3. If we push these integers in order, we will get:

1
2
3

Invoking pop will return 1 or the last element entered.

A Queue is a First In First Out (FIFO) data structure. It supports two basic operations called enQueue and deQueue. The enQueue operation adds an element at the beginning of the queue, and the deQueue operation removes an element from the end of the queue.

Example queue of integers: 1, 2, 3. If we queue these integers in order, we will get:

1 -> 2 -> 3

Invoking deQueue will return 3 or the first element entered.

This project contains tests for both stack and queue.

To run the test execute:

mvn test

About

Immutable Stack and Queue implementation in Java Programming Language.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages