# Thread: Need help with binary insertion algorithm

1. Member
Join Date
Sep 2013
Posts
2
Rep Power
0

## Need help with binary insertion algorithm

Hi first of all, im new to this forum and the main reason im here is my homework in "Algorithm and data structures".
Code is here

My task is to write a program to sort (a part of) a given list of comparable elements using binary insertion sort method. Binary insertion method is a modified insertion method that uses binary search to find the insertion point. Your implementation has to be stable (has to preserve the original order of equal elements). There are three parameters to your program:
a - the list;
left - starting index (included);
right - ending index (excluded).

The method signature is:

static public <T extends Object & Comparable<? super T>>
void biSort (List<T> a, int left, int right) , it starts at the line 130 "bisort" method.

2. Member
Join Date
Sep 2013
Posts
2
Rep Power
0

## Re: Need help with binary insertion algorithm

Originally Posted by kert666
Hi first of all, im new to this forum and the main reason im here is my homework in "Algorithm and data structures".
Code is here

My task is to write a program to sort (a part of) a given list of comparable elements using binary insertion sort method. Binary insertion method is a modified insertion method that uses binary search to find the insertion point. Your implementation has to be stable (has to preserve the original order of equal elements). There are three parameters to your program:
a - the list;
left - starting index (included);
right - ending index (excluded).

The method signature is:

static public <T extends Object & Comparable<? super T>>
void biSort (List<T> a, int left, int right) , it starts at the line 130 "bisort" method.
My problem is that i dont know how to create the insertion method for the binarysearch. If u take a look at my code theres my bugged solution for this task, perhaps someone could help me with it.

3. Moderator
Join Date
Apr 2009
Posts
13,215
Rep Power
23

## Re: Need help with binary insertion algorithm

Moving to New to Java from a staff only section.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•