This repository contains clean, educational implementations of classic sorting algorithms and fundamental data structures, written in Java as part of my preparation for competitive IT exams and as a technical complement to my project OOPPS.
All classes and methods follow standard English terminology after a full refactor focused on consistency and clarity.
- Strengthen understanding of classical data structures and algorithms
- Maintain a clean and readable educational codebase
- Support my exam preparation and reinforce Java fundamentals
- Serve as a simple, transparent reference for algorithmic concepts
- Java 17+
- No external dependencies
- Pure Java and standard library only
All sorting implementations include ascending and descending variants, plus small demo main methods.
- BubbleSort
- MergeSort
- QuickSort (Lomuto partition scheme)
Generic, ready-to-use data structures implemented from scratch:
- Stack (LIFO)
- Queue (FIFO)
- SinglyLinkedList
- DoublyLinkedList
Each structure includes:
- basic operations (push/pop, enqueue/dequeue, etc.)
- size and state checks
- console-based demo methods
int[] data = { 5, 1, 4, 2, 8 };
QuickSort.sortAscending(data);
System.out.println(Arrays.toString(data)); // [1, 2, 4, 5, 8]Run the demo
javac -d out src/com/nespapu/sorting/*.java
java -cp out com.nespapu.sorting.QuickSortDemoDoublyLinkedList<Integer> list = new DoublyLinkedList<>();
list.addLast(10);
list.addLast(20);
list.addLast(30);
list.printList(); // [10, 20, 30]
list.printListReverse(); // [30, 20, 10]SinglyLinkedList<Integer> list = new SinglyLinkedList<>();
list.addLast(1);
list.addLast(2);
list.addLast(3);
list.printList(); // [1, 2, 3]Stack<String> stack = new Stack<>();
stack.push("A");
stack.push("B");
stack.push("C");
System.out.println(stack.pop()); // C
System.out.println(stack.peek()); // B
System.out.println(stack.isEmpty()); // falseQueue<Integer> queue = new Queue<>();
queue.enqueue(10);
queue.enqueue(20);
queue.enqueue(30);
System.out.println(queue.dequeue()); // 10
System.out.println(queue.peek()); // 20Run the demo
javac -d out src/com/nespapu/structures/*.java
java -cp out com.nespapu.structures.QueueDemoPlanned improvements include:
- Adding unit tests (JUnit)
- Expanding the repository with additional algorithms and data structures
This project is open-source and distributed under the MIT License.
Copyright © 2025–present Néstor Pavón Puro.
For more information, see the LICENSE file.