« first day (1045 days earlier)      last day (3690 days later) » 

10:21
Hi everyone. I have a question about the workings of a simple sorting problem in my CS class. I thought of posting to SO at first but maybe here is better after all (and when I made an account on SO, it wasn't linked to mine on the rest of SE for some reason). If anyone can help I'd be very grateful.
@Noein Sure, feel free to post that as a question :-)
So, the problem asked us to sort ascendingly and descendingly four alphanumeric strings. We can't use array-like features and no built-in sorts (obviously) and used C++ to do it.
Now, the professor demonstrated a 'simple' way to do it, which to me looked too awful for any larger list than 4 (note: he did *not* present it as an all-around efficient way, just one way for our 4 item list).
@Juho Sure :D. Writing it down now...
He said to compare the 0th item to the 1st item, if the 0th comes before the 1st in a properly sorted list, leave as-is, otherwise swap. Repeat for n and n+m where m is a step farther from n everytime it is run (while n remains constant until it is compared to all numbers in the list).
Put another way, compare (0) to (1) then to (2) then to (3) to ensure that at (0) the newest swapped item is the the earliest in a properly sorted list among all the list items.
I tried looking for this method all over the internet and can't find anything about it. I think I can't describe it well enough, and I don't know a name for it.
My problem with is that, as I *imagine* but can't quite know, it would take (n-1)! steps to sort through any list, almost guaranteed in an already sorted list, for example, and isn't as not-algorithmic-really as bogosort, at the same time.
So, what am I missing?
Oh, n in (n-1)! is for the number of items in a list, not the 'n' I used earlier for the index of an item.
@Juho , I will once I know what I need to be looking for...
11:08
@Juho I argued for removing them before, but someone made the argument that they might be useful for language design questions, so they ended up not being blacklisted.
@Raphael Ah, I see. My feeling is that they do more bad than good, but oh well :-)
@Juho Dito. Imho, blacklisting them would show a person that should be on Stack Overflow "not here" (if they'd care is another question). I think @Gilles made the "stay"-argument back then?
 
2 hours later…
13:25
@Raphael I don't think removing the PL tags would make a visible difference. They always find a tag, when they don't find the programming language they're using they use or or (“my class is so complex!”) or whatever
14:00
@Gilles That's a good point, you're probably right
@Gilles So you are saying, keep OT-tags for the purpose of identifying some OT questions at first glance? Well, okay.
14:31
@Raphael No, I'm saying, keep the tags, because they are not the reason why people post off-topic questions
Causality goes the other way round: 1. post off-topic question; 2. you must pick a tag; 3. pick one that's the name of the programming language, or some other tag if you can't find it
I remember (maybe it wasn't on CS) questions tagged or where the asker said “hey, my question must be on-topic, since it's about something for class and there's a class tag”
 
2 hours later…
vzn
vzn
16:21
hi all small miracle WLs ad on cstheory is up to 5v. somebody plz click it 1 more & put it over the top to score! this could be the historic 1st se ad ever for this site! (nearly 3yr old now)... (codegolf managed to get theirs passed recently also.)
Noein it sounds like your teacher wants "swaps only"? how can one sort without "array-like operations"? that needs to be defined better. also complexity is presumably to be ignored with "funky sorts"... see eg bubblesort
vzn
vzn
17:23
huh this is strange. not following how those yearly ads work. supposedly the slate is wiped clean each year. but got to that upper 2014 link by clicking on the "comment" popup on a current cstheory codegolf.se ad that just came up.

« first day (1045 days earlier)      last day (3690 days later) »