program to brute force search, JAVA Programming

Introduction

As an alternative to the Binary Search algorithm, also it could be done by the brute-force method given below.

public static int rank(int key, int[] a) {
    for (inti=0; i         if (a[i]==key) return i ;
    return -1 ;
}

Procedure

Write a program BruteForceSearch that uses the brute-force approach given above and compare its running time on your computer with that of Binary Search for largeW.txt and largeT.txt, both available on moodle. Compare running times when running in two modes.

1. Results printed on screen:

javaBruteForceSearchlargeW.txt

2. Results redirected to a file:

javaBruteForceSearchlargeW.txt result.txt

You will (hopefully) see that solving the whitelist problem for a large number of inputs is not feasible without efficient algorithms such as binary search and mergesort.

Deliverable

a short report, including

  1. a code listing for BruteForceSearch.java
  2. a derivation of the predicted performance for both algorithms as functions of N, the number of records
  3. a comparison of your experimental results with predictions for these algorithms.
Posted Date: 3/8/2013 5:11:08 AM | Location : United States







Related Discussions:- program to brute force search, Assignment Help, Ask Question on program to brute force search, Get Answer, Expert's Help, program to brute force search Discussions

Write discussion on program to brute force search
Your posts are moderated
Related Questions
This project focuses on demonstrating the understanding of data types, input/output, sequential and selection programming statements, and mathematical operations. The project re

The Spring container is able to autowire relationships among collaborating beans. This means that it is possible to automatically let Spring resolve collaborators (other beans) for

Create a class to implement the ArrayList collection. The name should be YourFirstNameArrayList; for example if I were creating the class then I would call it WaynesArrayList. Do

What is Color in AWT? Color is a class in the AWT. Individual colors such as red or mauve are examples of this class, java.awt.Color. Be sure to import it if you want to use ot

A point-to-point model is based on the concept of a message queue: Senders send messages into the queue, and the receiver reads messages from this queue. In the point-to-point mode

1. Obtaining the new script: Download and save the attached comment CGI mailer script form-mail2.pl to your server's cgi-bin directory, and change the permissions on the script t

Why the number of temporary workers is on the rise? Discuss main reasons? Temporary workers: Temporary workers are those workers that a company can hire to perform a certain ta

write a program in java which enters name,roll #,and shows the sum of students english and maths marks?

1. RUP is relying on a few important principles and philosophies like planning ahead, knowing where the process is capturing and heading the project in extensible and storable mann

This is a two part project, one in Alice, and another in Java. You can either zip the files together as one and upload the single zip file, OR upload the separate files. If you dec