13,550,805 members
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");
}

}
}```

please help my sort make wrong sorting how can i repair it help please i wanna do it increasing sorting 2,9,14,132
Posted 19-Dec-12 1:00am

## 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

## 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

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Top Experts
Last 24hrsThis month
 ppolymorphe 160 OriginalGriff 160 Richard MacCutchan 149 Alan N 110 F-ES Sitecore 105
 OriginalGriff 5,030 ppolymorphe 2,227 Richard MacCutchan 2,120 Wendelius 1,865 Maciej Los 1,515

Advertise | Privacy |
Web03 | 2.8.180515.1 | Last Updated 19 Dec 2012