Test1Fsoln - head = nodeToMove public static void highlight(ArrayList<Airport> list int minLength int len = list.size for(int i = len-1

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
public void moveToFront(E element) { Node<E> prior = head; while (prior.next != null && !prior.next.data.equals(element)) { prior = prior.next; } if (prior.next != null) { // splice out node Node<E> nodeToMove = prior.next; prior.next = nodeToMove.next; // put it at front nodeToMove.next = head;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: head = nodeToMove; } } } public static void highlight(ArrayList<Airport> list, int minLength) { int len = list.size(); for (int i = len-1; i >=0; i--) { Airport a = list.get(i); if (a.getRunwayLength() >= minLength && !a.hasControlTower()) { list.add(i, new Airport("***", a.getRunwayLength(), false)); } } }...
View Full Document

This document was uploaded on 12/19/2009.

Ask a homework question - tutors are online