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

I need some Unique Idea About my final Year Project . It could be a Website or an Android application. I want to create Something very unique which in some sense benefits a society

I have to Create a program that determine the shipping cost for an order based on he following chart: From To Price $0.00 $19.99 $2.95 $20.00 $49.99 $3.95

Luminous Jewels - The Polishing Game Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various lum

What are the kinds of computer network according to the distance among nodes? The kinds of computer network according to the distance among nodes are: 1. LAN 2. WAN

a program to find the area under curve y=f(x) between x=a and x=b,integrate y=f(x) between the limits of a and b

explain jumps in loops and explain labelled loops

The Remote interface serves to recognize interfaces whose methods may be invoked from a non-local virtual machine. Any object that is a remote object must directly or indirectly ex


RMI Object services: In addition to its remote object architecture, RMI gives some basic object services, which may be needed in a distributed application. 1.  Object namin