Starting from:

$25

WT Assignment 2 Solved

  

1.   Write a java program to compare two strings lexicographically (without using library function).  

2.   Write a program to implement counting sort (with input in the range 0 to 20 and input can be repeated multiple times)  

3.   Write a program to sort strings (without using library function).  

4.   Find the smallest n such that Σi = i2 where 1 ≤ i ≤ n is too large to be represented as an int.  

5.   Let us define a couple of sets of integers, and let Java compute the set-theoretical operations (union, intersection and complement). We first fix our universe, which will consist of the 11 elements, Universe = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, A and B will be entered by users.  

a.   Only array can be used as data structure  

b.   Using any efficient data-structure available in Java  

c.   Compare the time to compute the operations  

6. Write a ConsoleProgram that reads in a number from the user and then displays the Hailstone sequence for that number (Pick some positive integer and call it n. If n is even, divide it by two. If n is odd, multiply it by three and add one. Continue this process until n is equal to one) 

 

More products