Design and implement recursive method findvalueunsortedarray

Assignment Help JAVA Programming
Reference no: EM131094269

Java- Data Structures and Analysis

Prefered Netbeans

Question 1

a) Design and implement a recursive method convert1 which takes two parameters: a positive integer number n (in base 10) and a positive integer number b between 2 and 9 inclusively. The method should return the number in base b which corresponds to the decimal number n. For example, convert1(19, 8) should return 23. It means that 19 in base 10 correspond to 23 in base 8. Hint. Note that n / 10 is an integer obtained by dropping the rightmost digit of n while n % 10 is the rightmost digit of n.

b) Design and implement a recursive method convert2 which takes two parameters: an integer b between 2 and 9 and a String n representing a numeric value in base b. The method should return an int value representing the decimal value of n. For example convert2 ("11101", 2) should return 29.

c) Design and implement TestQ1.java a Swing based GUI driver program to test the methods convert1 and convert2.

Question 2

Consider an array of size 20 fully populated with non-duplicated, random generated, unsorted integer values in the range -99..99.

a) Design and implement a recursive method findValueUnsortedArray which takes two parameters: an unsorted array of integer values and an integer value which is looked for in the array. The method returns the array index of the value being searched for if the value is in the array and -1 if the value is not in the array. The method should be splitting the array in two halves looking for the value in each of the two halves and so on ... until it gets to individual values that can be compared to the value which is searched for.

b) Using the Binary Search Method, design and implement a recursive method findValueSortedArray with the same signature and return value as the method findValueUnsortedArray.

c) What is the Big-O complexity of the two methods? Explain why they are different.

d) Design and implement TestQ2.java a driver program to test the methods findValueUnsortedArray and findValueSortedArray. Consider an array of size 20 initially populated with non-duplicated integer values.

Submission requirements

Submit the following before the due date listed in the Calendar:

1. The source files TestQ1.java and TestQ2.java. These source files should also include the required recursive methods. The source code should use Java code conventions and professional code layout regarding white space management, indents and comments.

2. The Solution description document <YourSecondName>_HW3 (.pdf or .doc / .docx) containing: (2.1) assumptions, main design decisions, error handling; (2.2) test cases and two relevant screenshots; (2.3) the answer and explanation required by question 2c); (2.4) lessons learned and (2.5) possible improvements. The size of the document file (including the screenshots) should be of two pages, single spaced, font size 10.

Requirements:

Design:

Employs Modularity (including proper use of parameters, use of local variables etc.) most of the time.

Employs correct & appropriate use of programming structures (loops, conditionals, classes etc.) most of the time.

Efficient algorithms used most of the time.

Excellent use of object-oriented design.

Functionality:

Program fulfills all functionality.

All requirements were fulfilled.

Extra effort was apparent.

Test Plan:

Comprehensive test plan.

Documentation:

Excellent comments.

Comprehensive lessons learned.

Excellent possible improvements included.

Excellent approach discussion and references.

Reference no: EM131094269

Questions Cloud

Will carter have to do so and is that fair : When the best offer she got for the desk was $2,500, Baker returned the desk to Carter. Baker told Carter that Ames had exceeded his authority in purchasing the desk, and she demanded that Carter refund the $3,000 that Ames had paid for the desk. ..
Impervious to terrorist attack or natural disasters : Past events have shown us that we are not impervious to terrorist attack or natural disasters. There have been many times in history that we have failed in vigilance and taken a lackadaisical approach.
Approximate probability that in a random sample : What is the approximate probability that in a random sample of 75 Black Friday shoppers, there will be 19 or more people who will camp out in front of a store?
Specified volume of absorption : The paper towels have a normal distribution with a mean of 49.5 ml and a standard deviation of 4.3 . If 3% of the paper towels exceed a specified volume of absorption of a, what is the value of a?
Design and implement recursive method findvalueunsortedarray : Design and implement a recursive method findValueUnsortedArray which takes two parameters: an unsorted array of integer values and an integer value which is looked for in the array.
Should the case be transferred to a south carolina venue : In this case, however, the studios objected when CleanFlicks edited the films and sold the altered versions directly to consumers. Similarly, CleanFlicks made unauthorized copies of the studios' DVDs to edit the films, but objected when others mad..
Problem regarding the volunteer work : What is the probability of randomly sampling 145 women 16 years of age or older and getting 35 or more who do volunteer work?
Differences in the relationships between wealth and income : Discuss differences in the relationships between wealth and income. For example, how might the wealth and income levels of the elderly be different from those of younger individuals who only recently entered the labor force?
Time lapsed between two consecutive trades : The probability that the time lapsed between two consecutive trades would fall below 13 seconds was 7%. What is the probability that the time lapsed between two consecutive trades will be longer than 17 seconds?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd