Ashish Maharaja Singh

Greenhorn
+ Follow
since Jun 06, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ashish Maharaja Singh

Campbell Ritchie wrote:Pencil, paper and a large eraser. That is what you need. You need to write down exactly how you intend to implement the splitting part of the algorithm, and how you stop when your divided arrays are 1 element long. Then you need to write down how to implement the merging part. When you have got it down to words of one syllable, you can convert your instructions into code quite easily.

I would suggest some more links about sorting: 1 2 3.



Thanks for the links. I am trying this again. Lots of paper in the bin already
10 years ago

Ulf Dittmer wrote:
The overhead becomes sizeable when the problem is tree-recursive (i.e., involves more than one recursive call per step) and goes to great depths.



I think that is what i am trying to do here. Please tell me if recursion is good for this or not. Please suggest ways to make a simple MergeSort program.

10 years ago

Ashish Schottky wrote:You can go here: to check how merge sort works and how it is implemented:
Programing AI



Thanks for the link. I prefer to do it myself. If there are any serious flaws in my approach, please let me know.
10 years ago
I am making a program to do MergeSort. It is not ready yet. Here is the test code which can split an array into half - works properly.
But I dont understand how it works - can someone explain this in terms of Stacks etc ?
Please let me know if my way is good or not.

What i am trying :
MyArray class has an int array called FULL. It stores the Left and Right halves of FULL in its Lt and Rt variables respectively.
It takes the array to be sorted and splits it into halves till array of size 1 is obtained. We (should) store the bottom-most array reference so
that we can go upwards (by using the MyArray "above" variable) and do the sorting.



10 years ago
Thanks to all for pointing the error.
Code works now.


10 years ago
I got this error in the following code. Please tell me why this happened and how to prevent it.


10 years ago
please tell me the error in my concepts. I am get this error on line "TempArray ta = new TempArray(le,ri);"



10 years ago