Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search Coderanch
Advance search
Google search
Register / Login
Ambreen Khanam
Greenhorn
+ Follow
4
Posts
3
Threads
0
Cows
since Apr 18, 2013
Merit badge:
grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
Ranch Hand Scavenger Hunt
Number Posts (4/100)
Number Threads Started (3/100)
Number Cows Received (0/5)
Number Likes Received (0/10)
Number Likes Granted (0/20)
Set bumper stickers in profile (0/3)
Report a post to the moderators (0/1)
Edit a wiki page (0/1)
Create a post with an image (0/2)
Greenhorn Scavenger Hunt
First Post
Number Posts (4/10)
Number Threads Started (3/10)
Number Likes Received (0/3)
Number Likes Granted (0/3)
Set bumper stickers in profile (0/1)
Set signature in profile
Search for a post/thread (0/3)
Set a watch on a thread
Save thread as a bookmark
Create a post with an image (0/1)
Recent posts by Ambreen Khanam
finding the top highest element from each of the 3 arrays
Hi..Can you please provide em the optimised sollution for the below problem.
There are 3 sorted arrays say. A[1,3,5,7,9....99] B[2,4,6,8,..100] C[5, 10,15, 20...95]
The output should be 99, 100, 95
show more
10 years ago
Java in General
Array elements frequency count using hashmap
Thanks Ritchie..
Are you talking about this example.
import java.util.*;
public class Freq {
public static void main(String[] args) {
Map<String, Integer> m = new HashMap<String, Integer>();
// Initialize frequency table from command line
for (String a : args) {
Integer freq = m.get(a);
m.put(a, (freq == null) ? 1 : freq + 1);
}
System.out.println(m.size() + " distinct words:");
System.out.println(m);
}
}
show more
10 years ago
Beginning Java
Array elements frequency count using hashmap
Hi,
Can anyone provide the optimised soln for this problem.
in an array say there are elements like A[1, 2, 4, 5, 4, 2, 1, 2]. How to caculate the frequency of each number and also print the no with the highest frequency.
This problem needs to be solved using hash map.
show more
10 years ago
Beginning Java
swapping the elements in an array at the given index
Please provide me the best optimised solution for the below problem.
Say there is an array Array[1,2,3,4,5,6,7,8]. The elements needs to be swapped from index 0 to 4. The output should be somethin like this.
5,4,3,2,1,6,7,8
show more
10 years ago
Java in General