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
Spring - JSF integration is useful when an event handler wishes to explicitly invoke the bean factory to make beans on demand, such as a bean that encapsulates the business logic t

Java Programming 1. What do you understand by Java Virtual Machine? 2. Write a simple Java program to display a string message and explain the steps of compilation and execu

Determine how many arguments were passed using length property In java, array knows their size by using the length property. By using, length property we can determine how many

Project Description: We need same kind of concept with some changes # Change single colors in a particular design. you need to be able to change the color of only the fox or

What limitations are placed on method overriding ?

THE FOLLOWING PROGRAM SHOULD BE JAVA IN ECLIPSE Minimal Spanning Tree Decreasing Edge Dismissal Reverse-delete algorithm. Develop an implementation that computes the MST as fol

What is required to be done from my programming is : I enter name,day(saturady or sunday),time( 10AM and 10PM) My program must then vaildate name,day and time. Name must only a

How can you define a consistent web design? Why is it needed? A consistent excellent designed website is generated for common public which permits users to attain what they nee


What can you do with an exception once you've caught it? 1. Fix the difficulty and try again. 2. Do anything else instead. 3. Exit the application along with System.exit() 4