Free Republic
Browse · Search
General/Chat
Topics · Post Article

To: Lazamataz

They asked me to, in Javascript, reverse an array of 100 numbers.
.....
They responded, “Sorting. Bubblesort, Quicksort, all sorts of stuff like that.”


Heck, sorting would only work (if you’ve described the problem correctly) if the array was originally sorted. If it was randomly-arranged items a sort wouldn’t reverse it.


38 posted on 02/09/2022 2:45:21 PM PST by DuncanWaring (The Lord uses the good ones; the bad ones use the Lord.)
[ Post Reply | Private Reply | To 10 | View Replies ]


To: DuncanWaring
Heck, sorting would only work (if you’ve described the problem correctly) if the array was originally sorted. If it was randomly-arranged items a sort wouldn’t reverse it.

Yeah. I forget the actual things they said people tried to solve it with, but every one of them was inordinately complex.

Mine was simple and super elegant.

61 posted on 02/09/2022 5:17:23 PM PST by Lazamataz (The forces of fascism and oppression are on the move in North America. We cannot let tyranny stand!)
[ Post Reply | Private Reply | To 38 | View Replies ]

Free Republic
Browse · Search
General/Chat
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson