Lab 13, Esc101, 2004-05 Semester-II

Solve the following problems


Problem 1

Given an array of size n, rotate the array towards right by 'k' positions using O(n) time and O(1) extra space.  Note that your method cannot be O(kn) time or O(k) space, since that would be bad if k were O(n) itself.



Problem 2   

Given a file, find the frequency of each word in that file and list all  the unique words and their frequencies. Use Java in-built Hashing API.