+ 1
Flash Sort
could Anyone help me to fix the bugs in this code I tried but can't fix all the bugs the line l commeted! https://code.sololearn.com/c9434xiqrh4X/?ref=app
13 Respostas
+ 2
Reading about flashsort now.
http://www.neubert.net/Flacodes/FLACodes.html#Sprung3
https://en.wikipedia.org/wiki/Flashsort
https://www.geeksforgeeks.org/quick-sort/
Why is you m value this formula ?
int m = (int)((0.2 * length) + 2);
wikipedia -> m=0.1n
Sorry have to stop here .
I can see j is continuing to increase, which causes the index out of bound.
But I do not know why that is.
https://code.sololearn.com/cmH0f8Ix9eQ0
+ 2
I will try. The geeks for geeks looked very readable. I like dr dobbs but the articles are hard to read.
+ 1
I did not read the whole code.
But I do miss a program class
Can you check the place of your brackets.
Do you mean to end the main method after 3 lines, or is this bracket here by misstake
static void Main(string[] args)
{
Program p = new Program();
int [] a = new int[7] {1,2,3,6,1,9,7};
p.flashsort(a, 7);
} //this is the end of main
{ //but there is not class-defintion or method-definition here
if (length == 0)
{
return;
}
+ 1
I correct this mistake but still it's not working đ„
+ 1
That is fine.
I had a look and there is a infinite loop created.
It seems that "j" is not set.
This makes j always smaller than L[K], which makes the loop infite.
https://code.sololearn.com/cmH0f8Ix9eQ0
+ 1
yes but when I uncommented the while loop it's not run infinite times but in that loop I faced exception index out of bounds and I cannot find a way to solve this problem and get the desired output
+ 1
do you have any knowledge about flash sort if you know about it then please check the the formula that I Use it in the program
+ 1
Sorry, I do not have knowledge of flashsort, I am just reading your code.
+ 1
no problem and thanks âșïž
+ 1
thanks a lot
+ 1
when finish this article can you answer my this question I'm still confused about it
https://www.sololearn.com/discuss/1657440/?ref=app
+ 1
yeah
0
yes but when I uncommented the while loop it's not run infinite times but in that loop I faced exception index out of bounds and I cannot find a way to solve this problem and get the desired output