Anuj Kulkarni
BAN USER
Comments (4)
Reputation 20
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
1
of 1 vote
public static void main(String[] args) {
String v1 = "2.12.11.09";
String v2 = "2.12.11.09";
String[] v1Split = v1.split("\\.");
String[] v2Split = v2.split("\\.");
if (v1Split.length != v2Split.length)
System.out.println("Version Numbers not equal");
else {
for (int i = 0, j = 0; i < v1Split.length; i++, j++) {
if (!v1Split[i].equals(v2Split[j])) {
System.out.println("Version Numbers not equal");
return;
}
}
}
System.out.println("Version Numbers are equal");
}
Comment hidden because of low score. Click to expand.
0
of 0 vote
very poor code... dont you know something like String[] str = string.split(characterRegEx) ??
- Anuj Kulkarni October 08, 2012Comment hidden because of low score. Click to expand.
1
of 1 vote
Its a wordcount problem in mapreduce.
One can refer this : wiki.apache.org/hadoop/WordCount
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
Imp thing here is it is designed for a mobile. I think best you can do apart from TRIE is store all the words in 26 files. Words starting with each unique alphabet in English each file (a-z 26 files). Inside the file you will have words with similar prefix just like in TRIE on different lines. So when user types first three letters of the word you know where exactly to search !
- Anuj Kulkarni February 13, 2014