Add Pancake Sort to the sorting algorithms#786
Add Pancake Sort to the sorting algorithms#786arthurvergacas wants to merge 1 commit intoTheAlgorithms:masterfrom arthurvergacas:master
Conversation
| @@ -0,0 +1,79 @@ | |||
| /** | |||
There was a problem hiding this comment.
This is just me being nitpicky again ;) This comment block should just start with /*
| } | ||
|
|
||
| /** | ||
| * The Pancake Sort algorithm. Note that even though it's a completely different |
There was a problem hiding this comment.
Aaaaand this one should just have the single sentence in the first line followed by an empty line ;)
|
Aside from me nagging about comment style, this looks really nice. Thank you! |
|
AAAAAA hahadhasd omg I didn't even realize that I had to change this one as well. I sent this pr before the one about Fermat, so I didn't have all my new knowledge about js comments and stuff. I'll change it asap. And thank you for the compliment! :) |
|
her @defaude..... I may have made something stupid.......... What if, hypothetically, I clicked on "Delete fork after the pull request is merged" when the pr about Fermat was merged, and, also hypothetically, this pr was in that fork as well, and now I can't make any changes here..... Could I possibly close this one and replace it with a new?? jasdasdhas I'm so sorry for all this mess, I had no idea that deleting the fork would do this 😭 😭 |
|
Oh dang. I see that your forked repo is gone. Well, take this as an opportunity to learn something :D When working with forked repos, it's always a good idea
In my opinion, deleting a repo should always be a deliberate decision and be executed manually, as well. Therefore, I think this whole "delete my fork after merge" feature is dangerous at best. However, you still have your local working copy of the repository, I guess? This means your commits aren't lost! You can just re-create the forked repository (should be created under the same name, and remote URL, I guess).
|
|
tbh I think it's interesting that your changes are still here somehow :) It seems Github has saved your changes in this PR even though the source repo doesn't exist anymore. However, you have most likely no way to add additional commits - I mean, where would you? :) |
Yeah!! Embrace the errors!!! hahadh And indeed, I didn't know about the Buuuut I think that we are still missing something, and I may have a guess of what it is. When I do git log in the Note the date there: October 13th. But when I look into the Algorithms repo that I just forked, this commit doesn't exist! And because of that, when I rebase in my local repo my commit is gone (:sob:) and when I make all the necessary changes, commit and push, Github just tells me that my fork is ahead of the origin, and I should open a new PR. Buuuut (for the second time) I did find this. It's a github article that talks about working on a PR whose fork has been gone. But in the end, they say to open a new PR ;-;. What do you think I should do? Open a new PR and close this one? Keep trying to recover it? Give up completely on git and start a farm in the hills? I'm open to any of your suggestions (including the farm one, I've always loved sheeps anyway 🐑 ) |
|
Is it really hard to just copy the two files, re-fork the repository, paste the two files and re-open a pr :) |
|
Well, not hard at all! I just hesitated to re-open a pr because I was afraid of any extra work that you guys might have to do. But if there's nothing wrong with closing it and opening a new one, I'm completely down for it! In fact, I'll do it rn! :)) But one more time, thanks @defaude for all your help and support in trying to recover my repo! :) It surely means a lot! :) 😊 |


Add Pancake Sort
In the spirit of Hacktoberfest, I've decided to add one of my favorite sorting algorithms: the Pancake Sort!
The main reason to like this algorithm, besides the replacement of comparisons with reversals, is of course its name; after all, who doesn't like pancakes? 🥞 😋
If something is off, please don't hesitate to comment in this PR!