Question: DATA STRUCTURES AND ALGORITHM ANALYSIS IN JAVA 1. Arrays vs Arraylist Methods - search ()/sort (), add ()/remove () INCLUDE Sort/search algorithms Analysis of Time

DATA STRUCTURES AND ALGORITHM ANALYSIS IN JAVA

DATA STRUCTURES AND ALGORITHM ANALYSIS IN JAVA 1. Arrays vs Arraylist Methods

1. Arrays vs Arraylist

Methods - search ()/sort (), add ()/remove ()

INCLUDE Sort/search algorithms

Analysis of Time for n= 100 n = 1000, n = 10000.

Use random numbers for input

2. #2.20 (Program) just code and analysis

#2.20

a. Write a program to determine if a positive integer, N, is prime. b. In terms of N, what is the worst-case running time of your program? (You should be able to do this in O(?N).) c. Let B equal the number of bits in the binary representation of N. What is the value of B? d. In terms of B, what is the worst-case running time of your program? e. Compare the running times to determine if a 20-bit number and a 40-bit number are prime. f. Is it more reasonable to give the running time in terms of N or B? Why?

3. Tower of Hanoi

Use recursion for program and include Big O-Notation analysis for the code

And also discuss greedy algorithm analysis.

1. Arrays vs Arraylist Methods - search ()/sort (), add ()/remove () INCLUDE Sort/search algorithms Analysis of Time for n= 100 n = 1000, n = 10000 Use random numbers for input 2. #2.20 (Program) just code and analysis a. Write a program to determine if a positive integer, N, is prime. b. In terms of N, what is the worst-case running time of your program? (You should 2.20 be able to do this in O(VN).) c. Let B equal the number of bits in the binary representation of N. What is the value of B? d. In terms of B, what is the worst-case running time of your program? e. Compare the running times to determine if a 20-bit number and a 40-bit number are prime f. Is it more reasonable to give the running time in terms of N or B? Why 3. Tower of Hanoi Use recursion for program and include Big O-Notation analysis for the codee And also discuss greedy algorithm analysis

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!