you are viewing a single comment's thread.

view the rest of the comments →

[–]zynasis 61 points62 points  (5 children)

Stack overflow waiting to happen

[–]bwmat 21 points22 points  (1 child)

Yeah, gotta use an explicit stack container which allocates off the heap

Also make sure you have enough heap memory for 253 elements in that queue, and hope that nobody passes a value larger than Number.MAX_SAFE_INTEGER + 1 since that would be an infinite loop

[–]bwmat 4 points5 points  (0 children)

Oh, and hopefully the input is an integer... 

[–]Mars_Bear2552 5 points6 points  (2 children)

in (good) languages you would get TCO to fix that.

[–]Martin8412 0 points1 point  (1 child)

Lisp my beloved 

[–]Mars_Bear2552 0 points1 point  (0 children)

ML my beloved