
// BigHouses.java
// Main file for CS410, Summer 1998, Homework 4

// Provided file with holes for you.

import java.io.*;
import java.util.*;

// The format of input files should be:
// NAME
// ADDRESS
// NAME
// ADDRESS
// ...


class BigHouses {

	// The only methods of BufferedReader you need are
	// readLine(), and close()
	// To read a file more than once, just call this method again.
	static BufferedReader openInputFile (String filename) throws IOException {
		FileInputStream fis = new FileInputStream (filename);
        InputStreamReader isr = new InputStreamReader (fis);
        return new BufferedReader (isr);
	}

	// The only methods of PrintWriter you need are
	// println(String s) and close().  The only PrintWriter you need is
	// created for you in main.
	static PrintWriter openOutputFile (String filename) throws IOException{
		return new PrintWriter(new FileWriter(filename));
	}

	static void printBigHousesOnePass(String fname, int m, 
										PrintWriter outfile) throws IOException{
		// fill me in
	}

	static void printBigHousesTwoPass(String fname, int m, 
									  PrintWriter outfile) throws IOException{
		// fill me in
	}

	static void printIntersection(String fname1, String fname2, 
								  PrintWriter outfile) throws IOException {
		// fill me in
	}

	public static void main (String [] args) throws IOException {
		String fname1 = "cornell.txt";
		String fname2 = "ithaca.txt";
		int numBiggest = 25; // be sure to test with different values
		PrintWriter output = openOutputFile("hw4answers.txt");

		long start, end;

		output.println("******* Begin Approach A ********");
		start = System.currentTimeMillis();
		printBigHousesOnePass(fname1, numBiggest, output);
		System.gc();
		end = System.currentTimeMillis();
		output.println("******** Approach A: " + (end - start) + " milliseconds"
			           + "*********");

		output.println("******* Begin Approach B ********");
		start = System.currentTimeMillis();
		printBigHousesTwoPass(fname1, numBiggest, output);
		System.gc();
		end = System.currentTimeMillis();
		output.println("******** Approach B: " + (end - start) + " milliseconds"
			           + "*********");
		
		output.println("******* Intersection ************");
		printIntersection(fname1, fname2, output);
		
		output.close();
	}
}