13,007,563 members (62,328 online)
Rate this:
See more:
```using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DS
{
class Sort
{
public String strYour_name = "Çağrı TAÇYİLDİZ";
public long Your_number = 1502510097; //okul numarası;

public void Our_sort(UInt32[] array, int p, int q, int digit)
{
// 132= 10000100    00001001
//14 =   00001100    00001100
//2 =     00000010    00000010
//9 =      00001001    10000100
if (array == null)
return;
int i = p;
int j = q;
while (i <= j)
{
while (i<=q && FindBinaryValue(array[i])[digit] == '0')
i++;
while (j>=p && FindBinaryValue(array[j])[digit] != '0')
j--;
if (i <= j)
{
uint tmp = array[i];
array[i++] = array[j];
array[j--] = tmp;
}
}
if (j > p)
{
Our_sort(array, p, j,digit+1);
}
if (i < q)
{
Our_sort(array, i, q,digit+1);
}
}
public string FindBinaryValue(uint a)
{
var st = Convert.ToString(a, 2);
}
}
}```

```using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DS
{
class Program
{
public static void Main(string[] args)
{

UInt32[] array = new UInt32[4] { 132, 2, 14, 9 };
Sort sorter = new Sort();

sorter.Our_sort(array, 0, 3, 1);

Console.WriteLine("Siralamadan sonra array su sekilde: ");
Console.Write("[");
for (int i = 0; i < array.Length - 1; i++)
{
Console.Write(array[i] + ", ");
}
Console.Write(array[array.Length - 1] + "]\n");
}

}
}```

Posted 19-Dec-12 1:00am

Rate this:

## Solution 2

Start by taking a close look at:
Array.Sort[^]

Then consider what you are actually doing here:
```public string FindBinaryValue(uint a)
{
var st = Convert.ToString(a, 2);
}```

`a` is a binary representation of the value, what you return is not, it's a string.

It looks like you are implementing the Quicksort[^] in c#, and by converting `a` to a string you're making a very big "O".

Best regards
Espen Harlinn
Rate this:

## Solution 1

Trust me on this: "immediately help please"
Does not help your case, nor does posting the same code over and over again, with minor changes and not trying to work out what the problem is yourself.

As I said last time: Use the debugger. Work out what should happen and follow the code through to find out what does happen. Then look to see if you can spot why. It will probably take you less time than posting repeatedly, and may mean that you get to hand your homework in on time.

If you try to debug it, and come up with a concrete question instead of "HELP! It doesn't work!" they we will try to help you - but you have to try to help yourself first!
oooozzzzi 19-Dec-12 7:38am

ok you are right but i am a erasmus student i saw c an python not c# so i couldnt run the program because of not my algortihm my syntax error now i runned it thanks again

Top Experts
Last 24hrsThis month
 Karthik Bangalore 235 OriginalGriff 75 Prifti Constantine 75 F-ES Sitecore 65 TheRealSteveJudge 60
 OriginalGriff 5,260 ppolymorphe 2,627 RickZeeland 2,570 Kornfeld Eliyahu Peter 2,156 Richard Deeming 1,763