All pastes #911463 Raw Edit

Someone

public text v1 · immutable
·published 2008-02-20 18:45 UTC
rendered paste body
///// Josh Alberts
//// Java AB Period 9
/// Valentine's Day
// HeapSort Main

import java.util.Scanner;

public class HeapMain
{
	public static void main(String[] args)
	{
		HeapPriorityQueue h = new HeapPriorityQueue();
		Scanner scan = new Scanner(System.in);
		String entry = "l";
		
		while (!entry.equals("quit"))
		{
			System.out.println("Enter a letter:");
			entry = scan.next();
			if (entry.equals("quit"))
				break;
			h.add(entry);
		}
		System.out.println("Printing....");
		h.traverseInOrder();
		
		entry = "y";
		while (entry.equals("y"))
		{
			System.out.println("Would you like to remove the minimum value?");
			entry = scan.next();
			System.out.println("The new list is:");
			h.removeMin();
			h.traverseInOrder();
		}
	}
}