chandan.here4u
BAN USER- 0of 0 votes
AnswersYou have an input file which has one word per line. Write a java
- chandan.here4u
program which takes this input file and produces an output file satisfying
the following conditions:
a. Each line of output file should have 1 word
b. Output file should contain input file words sorted by frequency
i.e. most frequent words appear at the top and least frequent words at
the bottom
c. For two words having same frequency in the input file, they should
appear sorted alphabetically. for e.g. if A appears thrice and B
appears thrice in input file, output file should have A appearing on
three lines and then B appearing on three lines
d. If an input word is repeated X times, it should appear on X lines
in the output file.
Sample input/output file are as follows:
Input Output
Dog Abhishek
Amar Abhishek
Abhishek Abhishek
Abhishek Amar
Amar Amar
Abhishek Amar
Amar Dog
Boy Dog
Ball Ball
Dog Boy| Report Duplicate | Flag | PURGE
Software Engineer / Developer Java
other.firstName must b replaced wid other.getFirstName()......also instanceOf shud b replaced wid this.getClass().getName().equals(other.getClass().getName()) ......dis ll prevent comaprison between parent-subclass objects.
- chandan.here4u May 23, 2011true.....
- chandan.here4u May 23, 2011definitely....to make primitive data types as other class-objects..........an OOPs feature of java
- chandan.here4u May 22, 2011wrong...it shud b minimum 11
- chandan.here4u May 22, 20111. total number = !n * Catalan Number
11. Unique trees no= Catalan number
sounds acceptabel
- chandan.here4u May 21, 2011agree!!
- chandan.here4u May 21, 2011
adding to this......e.g. String is a final class whose methods are nevr desired to be overriden
- chandan.here4u May 24, 2011