Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

MaxHeaps

This Java program implements a Max Heap data structure that manages characters. The heap organizes characters such that the largest character
(in terms of its lexicographical order) is always at the root of the heap. The program supports adding characters, removing the largest character,
and performing some additional operations like displaying and traversing the heap in preorder.

Commands

A to Z (UPPERCASE ONLY) - adds the character to the heap using the add() method.
* (asterisk) - prints the root of the heap (the maximum character) and removes it using the delete() method.
# (hash) - displays the current state of the heap.
! (exclamation) - performs a preorder traversal of the heap and prints the result.

Sample input

ABCDE*!#

output:

E
E 
A B D C 
E D B A C 

About

Java program that implements a Max Heap data structure

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages