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
Android App Project Description: I am seeking an experienced individual to prepare a small android application The only difference is that I would like movement to be done

I want School Management project Project Description: An easy school management project which able to store all data about students like fees structure, admission details and

What is image processing? It field of computer whereas we enhance and manipulate the graphics. Like it is used to recover old photograph and through processing we can revive

An aspect is the cross-cutting functionality that you are executing. It is the aspect of your application you are modularizing. An example of an aspect is logging. Logging is somet


Excel File to Responsive CSS/HTML page Project Description: Excel file to be converted into a responsive form for a site. In the excel file you will see where the input field

What is the Data Normalization? Also define its goal. Data normalization is to sort out complex data within easy form. It uses to simplify the complex information to form it mo

I have to weave two positive integers together. For example, if the numbers are 137 and 064, the output integer would be 103647. This has to be done using integer arithmetic (not s

Create a thread in either a C or a Java program and run it. The thread should read a keyboard value "x" and exit from the code, or it can also use an "ESC" to exit. That is, the t