[SOLVED] CS Java package edu.iastate.cs311.hw2;

$25

File Name: CS_Java_package_edu.iastate.cs311.hw2;.zip
File Size: 357.96 KB

5/5 - (1 vote)

package edu.iastate.cs311.hw2;

/**
* @author
*
* This code template is prepared by Xiaoqiu Huang
* You are welcome to add your own code for testing.
*/

import java.util.List;
import java.util.ArrayList;

public class Application
{

public static void main(String[] args)
{
Heap pq = new Heap ();
pq.add(10);
pq.add(15);
pq.add(20);
pq.add(30);
pq.add(25);
pq.add(25);
pq.add(30);
pq.add(40);
pq.add(35);
pq.add(50);
pq.add(10);
pq.showHeap();
System.out.println( pq.getLastInternal() );
pq.trimEveryLeaf();
pq.showHeap();
while ( ! pq.isEmpty() )
{
System.out.println( pq.removeMin() );
}

List alist = new ArrayList ();
alist.add(TGA);
alist.add(ACG);
alist.add(GCT);
alist.add(GTA);
System.out.println( Before sorting: + alist.toString() );
Heap.heapSort(alist);
System.out.println( After sorting: + alist.toString() );
}
}

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] CS Java package edu.iastate.cs311.hw2;
$25