Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Immutable data structures

Name: Anonymous 2018-12-03 18:54

How do you implement a POP operation on a STACK without returning multiple values?

Name: Anonymous 2018-12-04 0:50

not sure why you wouldn't want to modify the original one, but I guess an immutable stack would just create a new stack object and populate it with the same shit in the original one, sans the top thing to be popped

I guess you could use a generic class array, like Object[], and the popped value would be index 0, and the new stack would be index 1

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List