Merge sort question Computer Science |
- Merge sort question
- I wrote an iterative method for calculating Fibonacci numbers using only one if-statement, is it possible to have zero?
- Why is my own implementation of Bubble Sort so much slower than another one I found online?
- Finally, a Problem That Only Quantum Computers Will Ever Be Able to Solve | Quanta Magazine
Posted: 24 Jun 2018 01:08 AM PDT I'm a high school teacher currently marking some simple student work. One of the tasks I set is for them to demonstrate how a merge sort would sort a simple list of 16 numbers. I have always understood this (and taught) that it's a divide and conquer algorithm, where you first split the list in half and half again until you get lists of single values, then start merging these lists together until the whole list is sorted. So in terms of size of lists at each stage it would go 16, 8, 4, 2, 1, 2, 4, 8, 16. This seems to be backed up by YouTube videos and textbooks. However, I'm now doubting myself. A lot of students (and I mean a LOT, in different classes that don't know each other) seem to be splitting down to the stage of the lists being size 2, then magically sorting this list, then continuing as normal to merge. I would normally just mark it (or that part of it) as wrong and move on, but the fact that so many of them are doing the same thing makes me think there is some resource out there that does it this way. Is it wrong? (Thanks!) [link] [comments] |
Posted: 23 Jun 2018 07:10 AM PDT The following is my Java-code. Is it possible to have zero if-statements? Of course you could use a switch, but that doesn't count. Edit: thanks, it does work without the first if-statement like so: Sometimes the answer is already there ;) [link] [comments] |
Why is my own implementation of Bubble Sort so much slower than another one I found online? Posted: 23 Jun 2018 11:02 AM PDT I wrote my implementation of Bubble Sort according to my understanding of the general principle of how the algorithm works, and then compared it against another implementation I found online. While I'm not sure why that is. Can anyone help me understand? It can't be the additional checks against [link] [comments] |
Finally, a Problem That Only Quantum Computers Will Ever Be Able to Solve | Quanta Magazine Posted: 23 Jun 2018 11:45 AM PDT |
You are subscribed to email updates from Computer Science: Theory and Application. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google, 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
No comments:
Post a Comment