program to brute force search, JAVA Programming


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 ;


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:


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.


a short report, including

  1. a code listing for
  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
Question 4 Write a program that receives two integer inputs from a user, an ending value, lastvalue and column, column. The program will display all numbers from 1 to lastvalue

Project Description: Modules of software: 1 - Serial RS232 comm port comunication 2 - NanoHTTPD serving some processed pages 3 - System tray application to indicate sta

There are two significant bean lifecycle methods. The first one is setup which is called when the bean is loaded on to the container. The second method is the teardown method which

Write a program that takes as input a sequence of transactions of the form "buy x; share(s) at $y each" or "sell x share(s) at $y each," assuming that the transactions occur on con

A socket is one end-point of a two-way communication link among two programs running on the network. A socket is bound to a port number so that the TCP layer can recognize the appl

the textbok is Introduction to Java™ Programming, Brief Version, Eighth Edition Week 8 Exercises Chapter 8 Programming Exercises from Pages 295 - 299. Do Exercise Problems 2,

How are this () and super() used with constructors? this() Constructors: is used to pointing current class instance. Can be used with methods or variables. Used to call

EJBs are distributed elements, which need the RMI framework for object distribution. An EJB application server gives more services like object pooling, transaction management, data

Create a compressed file that contains the eclipse project directory and a short document that describes:   the methods implemented any missing or incomplete elements o