Skip to content

Add Merge Sort algo chapter and Python example #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from
Closed

Add Merge Sort algo chapter and Python example #163

wants to merge 10 commits into from

Conversation

Mukundan314
Copy link
Contributor

No description provided.

@Butt4cak3 Butt4cak3 changed the title Add Merge Sort algo Add Merge Sort algo in Python Jun 29, 2018
@Butt4cak3 Butt4cak3 added Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.) Chapter This provides a new chapter. (md files are edited) labels Jun 29, 2018
@Butt4cak3 Butt4cak3 changed the title Add Merge Sort algo in Python Add Merge Sort algo chapter and Python example Jun 29, 2018
@Butt4cak3
Copy link
Contributor

I updated your PR title to reflect the entire scope of this PR.

Text chapters are currently not yet open for contributions. Until now, @leios was the only writer and everyone else just submitted code examples. We're in the process of opening this aspect of the book up, so that more people can write chapters, but we're not done yet and we're not sure who will be able to do it.

It's ultimately @leios' decision whether to include this. Maybe you two can work something out.

@zsparal
Copy link
Contributor

zsparal commented Jun 29, 2018

This is also copy-pasted from Wikipedia which might not be what we want to do

@Butt4cak3
Copy link
Contributor

Good catch, @Gustorn. I didn't even think about checking for plagiarism. That's a no-go.

@leios
Copy link
Member

leios commented Jun 29, 2018

Oh yeah, a lot of work needs to be done on the text here, but I really appreciate the contribution! I am not sure the best way to handle this, but we have 3 options:

  1. You keep re-writing the text until we are satisfied
  2. I rewrite the text and send a PR to you
  3. I rewrite the text, put it on the AAA and then you resubmit your code then

As a note: I don't mind opening up the AAA for text contributions. The community has indicated they would like to have more authors; however, I will be harsh on chapters because I need to keep a semi-consistent style.

@Mukundan314
Copy link
Contributor Author

Mukundan314 commented Jun 29, 2018

options 2 and 3 look good to me since I was never good at explaining stuff.

@leios
Copy link
Member

leios commented Jun 29, 2018

Great! Not a problem. Since I know we have code waiting for this chapter and I am sure people are interested in writing some code for it, I'll bump it up the writing list and try to get it done this weekend. Wait a few days, and I'll try to get the chapter up.

Standard procedure for chapters is to leave the chapter up for a week to make sure there are no large comments or questions and that the code is in a generally understandable state.

I will choose between the 2 options depending on how the chapter shapes up. If I can use your code, then we'll use it as the fundamental merge-sort example and I'll add Julia code to that in a separate PR. If I need to write some small functions myself for the bulk text, then I might ask for you to resubmit the code at a later date.

Basically, give me a bit to figure out the text.

@Butt4cak3
Copy link
Contributor

My suggestion would be to turn the .md file into a stub with just a title and a note that "This chapter is coming soon". We can then add the Python code import at the bottom of it and merge the entire thing. When you (@leios) write the chapter, the .md file is already there and you can add the text to it.

@leios
Copy link
Member

leios commented Jun 29, 2018

Yeah, that's a good solution

Conceptually, a merge sort works as follows:
1. Divide the unsorted list into n sublists, each containing 1 element (a list of 1 element is considered sorted).
2. Repeatedly merge sublists to produce new sorted sublists until there is only 1 sublist remaining. This will be the sorted list.
# This Chapter is comming soon
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"coming" is spelled with only one "m".

@Butt4cak3
Copy link
Contributor

It has been almost two months now. I'm a bit out of the loop because of my break, so @leios, what's your plan regarding stub articles like this now?

Aside from that, this PR has become "dirty". 30a5ab2 does not belong here. It is completely unrelated to what this PR is about. I assume you (@Mukundan314) accidentally committed to this PR instead of a separate branch. If you need any help removing the commit, let me know.

@leios
Copy link
Member

leios commented Aug 28, 2018

Yeah, right now I clearly don't have the time to re-write this chapter... But is there any harm in leaving it up?

@Butt4cak3
Copy link
Contributor

But is there any harm in leaving it up?

You mean leaving the PR up? None at all. I just like digging up old PRs from time to time to see if we can make some progress on them.

@leios
Copy link
Member

leios commented Aug 28, 2018

Yeah, no problem leaving it up. It's good to bump it so it's back on my radar.

@ntindle
Copy link
Member

ntindle commented Aug 28, 2021

[lang: python]

@github-actions github-actions bot added the lang: python Python programming language label Aug 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chapter This provides a new chapter. (md files are edited) Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.) lang: python Python programming language
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants