User talk:Maju wiki

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia


Welcome!

Hello, Maju wiki, and welcome to Wikipedia! Thank you for your contributions. I hope you like the place and decide to stay. Unfortunately, one or more of the pages you created, like TortoiseBzr, may not conform to some of Wikipedia's guidelines for page creation, and may soon be deleted.

You may also wish to consider using a Wizard to help you create articles. See the Article Wizard.

Thank you.

There's a page about creating articles you may want to read called Your first article. If you are stuck, and looking for help, please come to the New contributors' help page, where experienced Wikipedians can answer any queries you have! Or, you can just type {{helpme}} on this page, and someone will show up shortly to answer your questions. Here are a few other good links for newcomers:

I hope you enjoy editing here and being a Wikipedian! Please sign your name on talk pages using four tildes (~~~~); this will automatically produce your name and the date. If you have any questions, check out Wikipedia:Where to ask a question or ask me on my talk page. Again, welcome! Joe Chill (talk) 22:28, 14 January 2010 (UTC)[reply]

I have nominated TortoiseBzr, an article that you created, for deletion. I do not think that this article satisfies Wikipedia's criteria for inclusion, and have explained why at Wikipedia:Articles for deletion/TortoiseBzr. Your opinions on the matter are welcome at that same discussion page; also, you are welcome to edit the article to address these concerns. Thank you for your time.

Please contact me if you're unsure why you received this message. Joe Chill (talk) 22:28, 14 January 2010 (UTC)[reply]

Tintin[edit]

Nice job! —Prhartcom (talk) 12:48, 1 February 2013 (UTC)[reply]

questionable comment in merge sort top down implementation[edit]

  • Note I changesd the title of this section here and in the merge sort talk page since the comment is questionable, not in error. Rcgldr (talk) 12:53, 11 April 2013 (UTC)[reply]
  • Note I split up this section to separate the issues. Rcgldr (talk) 04:55, 11 April 2013 (UTC)[reply]
  • Note, I updated the talks page to be similar to this section. If there is insufficient or no feedback from others in the main talk section, I won't make any changes to the algorithm section, since it's pointless if no one else cares. Rcgldr (talk) 12:41, 11 April 2013 (UTC)[reply]

Merge_sort#Top-down_implementation was previously written in C so that it would closely match the bottom up implementation, was replaced with a C# example, that isn't as closely matched, and there's a questionable comment since it's not clear if the comment refers to the recursve call being made or to the list returned by the recursive call.

From Merge_sort#Top-down_implementation in the source fragment

	//3/4 Recursively sort both arrays
	left = TopDownMergeSort (left);
	right = TopDownMergeSort (right);

These calls do not do any sorting, they only recursively divide sub-lists until sub-list size is 1. No actual sorting occurs until the function Merge() is called in the lines following this code. Rcgldr (talk) 00:30, 11 April 2013 (UTC)[reply]

I'm not sure I follow your logic a call to TopDownMergeSort definitely sorts the array passed to it. The 'Merge' method is called inside the recursive call. However if this is unclear, we should change it. maju (talk) 01:59, 11 April 2013 (UTC)[reply]
It's understood that the overall result sorts the data. My issue is that the comments in the code should apply to the lines of code in the current instance of TopDownMergeSort(), not to the overall effect of layers of recursion. Those lines of code are just a continuation of the process of dividing a list and recursively calling TopDownMergeSort() until the list size is 1. What needs to be made clear is that until some instance of TopDownMergeSort() reaches the line that calls Merge(), no sorting has taken place, only the splitting of lists, and that no instance of TopDownMergeSort() returns until after a call is made to Merge().
The only lines of code that contain the logic to actually sort data are contained in Merge(), not TopDownMergeSort(). Rcgldr (talk) 04:55, 11 April 2013 (UTC)[reply]
I have changed the c example to c# because the pointer manipulation and passing sizes obscures the logic. I strongly believe that freeing memory is not part of the algorithm. I you dislike c# as the language we could go for Python or other language, but I will strongly argue with 'native' support for arrays, no pointers and 'automatic' memory management. maju (talk) 01:59, 11 April 2013 (UTC)[reply]
The main issue is that without using pointers, I'm not sure how you efficiently (no uneeded copying of data) implement the bottom up merge sort which swaps the pointers between input and output buffers after each pass. If a proper bottom up merge sort needs pointers, then to be consistent, the top down merge should also use pointers in order to make comparing the different methods easier. Rcgldr (talk) 00:36, 12 April 2013 (UTC)[reply]
My example did not pass any sizes as parameters. The newlist() function sets the structure size when it's called to create a new list. I could change this to C++ and create a class that has size() as a member instead of using ->size. I don't dislike c#, but I was trying to make it clear that lists were being created and deleted as part of the process, in order to better compare the differences beween top down (many lists being created and deleted), versus bottom up (one list created to be used as a second list, and one list deleted when the sort is completed (the code can be modified so that the original list always ends up with sorted data, but this is an optimization not required for the examples). Rcgldr (talk) 00:36, 12 April 2013 (UTC)[reply]
Lastly, I see a lot of value in the fact that the c# code deals with anything that can be compared whereas the c code deals only with integers. (talk) 01:59, 11 April 2013 (UTC)
The data in that structure could be anything that can be compared. I used 64 bit unsigned integers as an example to keep the example simple. Only size needs to be an integer. Rcgldr (talk) 04:55, 11 April 2013 (UTC)[reply]


  • request for consistent instances of array.copy

To make the array.copy() calls consistent, change

	Array.Copy (toSort, left, leftSize);
	Array.Copy (toSort, leftSize, right, 0, toSort.Length - leftSize);

to

	Array.Copy (toSort, 0,        left,  0, leftSize);
	Array.Copy (toSort, leftSize, right, 0, toSort.Length - leftSize);
Rcgldr (talk) 05:18, 11 April 2013 (UTC)[reply]


  • I'm not sure top down implementation is that important, since it's rarely used other than as a classroom exercise. Most library or commercial immplementations of merge sort are bottom up, or a hybrid bottom up where the initial past uses some in place sort on small sub-lists. Rcgldr (talk) 12:53, 11 April 2013 (UTC)[reply]

proposed C++ examples for merge sort[edit]

I added C++ / STL / vector examples to the merge sort talk page here: Talk:Merge_sort#Algorithm_-_C.2B.2B_vector_code_examples. Both examples are using pass by reference, since the bottom up needs pass by reference in order for the indexing to work. The top down doesn't need pass by reference, but I left it there to keep the two examples consistent. These could be converted to psuedo-code where it wouldn't matter. In the top down example, the declaration of left and right lists also copies data from the main list, using STL vector iterators, and I added comments to explain that, but I'm not sure if there's a readbility issue there. These could be redone in C#, but the bottom up still needs pass by reference, so for consistency, the top down should also use pass by reference. Again, if the examples are converted to psuedo code, then language specific differences would go away. Seems like Grlx is the only other person (besides us) looking at that article at this point. I'll wait for feedback from both of you before I consider making any changes, perhaps creating psuedo-code versions. What I want is for the top down and bottom up implementations in the main article to use the same style, and as much as possible the same names for functions and variables when possible. Rcgldr (talk) 06:11, 22 April 2013 (UTC)[reply]