Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search Coderanch
Advance search
Google search
Register / Login
Alex Mokosh
Greenhorn
+ Follow
4
Posts
1
Threads
0
Cows
since Feb 06, 2012
Merit badge:
grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
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 (1/100)
Number Cows Received (0/5)
Number Likes Received (1/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 (1/10)
Number Likes Received (1/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 Alex Mokosh
insertion sort
I got it now, that works, thanks for your help
show more
12 years ago
Beginning Java
insertion sort
I just can not figure it out.
show more
12 years ago
Beginning Java
insertion sort
I fixed it,thanks, now I got some normal output bcdb, but it's wrong, should be abcd, so can you find some error in my code??
show more
12 years ago
Beginning Java
insertion sort
Hi, I'm a new here and I need some help to solve this problem.
I need to sort String alphabetically by using insertion sort, so that's what I've got so far:
private static char[] ch; static String res; // in the main String ab = {bcad}; System.out.println(sort(ab); public static String sort(String st){ ch = st.toCharArray(); for (int i=1;i<st.length();i++){ int j=1; int B =ch[i]; while((j>0) && (ch[j-1]>B)){ ch[j]=ch[j-1]; j--; } ch[j]=ch[i]; res=ch.toString(); } } return res; } // and at the end I've got some weird result [C@42e816
So, any ideas, what's wrong in my code???
show more
12 years ago
Beginning Java