Timeline for I don't want the smallest one, I want the second-smallest one
Current License: CC BY-SA 4.0
25 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 8, 2020 at 17:51 | comment | added | Stef |
"In addition, you may use the standard arithmetic operations + , - , * , / , and ^ ." Is ^ exponentiation or bitwise xor?
|
|
S Aug 26, 2020 at 15:31 | history | bounty ended | humn | ||
S Aug 26, 2020 at 15:31 | history | notice removed | humn | ||
S Aug 24, 2020 at 17:42 | history | bounty started | humn | ||
S Aug 24, 2020 at 17:42 | history | notice added | humn | Reward existing answer | |
Aug 23, 2020 at 18:54 | vote | accept | Michael Seifert | ||
Aug 22, 2020 at 7:35 | comment | added | justhalf | @CaptainGiraffe I think it's different. This question asks for a branchless expression (i.e., no conditionals). While the methods in selection algorithm uses series of instructions to find it, where the next instruction to execute depends on the result of the previous one. | |
Aug 21, 2020 at 23:35 | comment | added | Captain Giraffe | This is might be what you are looking for: en.wikipedia.org/wiki/Selection_algorithm | |
Aug 21, 2020 at 19:45 | answer | added | Bass | timeline score: 6 | |
Aug 21, 2020 at 15:44 | comment | added | chtz | Does your language allow assigning variables and iterating through a list? Or does it allow (tail-) recursion? | |
Aug 21, 2020 at 12:54 | comment | added | Michael Seifert | @melfnt: Yes, you can assume that $m$ is known when you write the function. However, you should describe how the program would be written for an arbitrary value of $m$ (if that makes sense.) | |
Aug 21, 2020 at 12:53 | comment | added | Michael Seifert | @humn: Yes, the solution I came up with uses $O(m^2)$ instances of each $x_i$. | |
Aug 21, 2020 at 9:15 | comment | added | melfnt | Do you know the value of $m$ before writing the program? | |
Aug 21, 2020 at 2:51 | comment | added | justhalf | The answer to this question will be useful for this purpose: YouTube video for Second Cheapest Wine | |
Aug 21, 2020 at 1:25 | answer | added | Misha Lavrov | timeline score: 10 | |
Aug 20, 2020 at 21:52 | history | became hot network question | |||
Aug 20, 2020 at 20:58 | comment | added | humn | Dear @Michael Seifert, does the intended solution for 2nd-in-order use $O(m^2)$ instances of $x_i$ as in the two answers so far, whose numbers of instances are $m^2\!{-}m$ and $m^2$? | |
Aug 20, 2020 at 15:48 | answer | added | athin | timeline score: 27 | |
Aug 20, 2020 at 15:14 | history | edited | Michael Seifert | CC BY-SA 4.0 |
added 49 characters in body
|
Aug 20, 2020 at 15:13 | comment | added | Michael Seifert | @kaitlynmm569: Oliver's understanding is correct. I'll try to edit this to make it clearer. | |
Aug 20, 2020 at 14:48 | comment | added | kaitlynmm569 | @Oliver I guess the question somewhat contradicts itself, as it asks for the second smallest number (indicating that it should be greater than the smallest), and then it asks for the second number in an ordered list. | |
Aug 20, 2020 at 14:44 | answer | added | Jan Ivan | timeline score: 20 | |
Aug 20, 2020 at 14:41 | comment | added | Oliver | From my understanding, duplicates seem to count, so the ordered list would be {4,4,4,4,5,5} not {4,5} | |
Aug 20, 2020 at 14:38 | comment | added | kaitlynmm569 | If the numbers are {4,5,4,4,4,5}, the function should return 4 Shouldn't the function return 5 here, since 4 is the smallest number? | |
Aug 20, 2020 at 13:51 | history | asked | Michael Seifert | CC BY-SA 4.0 |