> Which method removes and returns the last element of an array?
The answer is “pop”, right? I think that’s a fairly generic data structures question (if you treat the word array as a standin for any modern iterable collection type.)
The answer is “pop”, right? I think that’s a fairly generic data structures question (if you treat the word array as a standin for any modern iterable collection type.)
See also https://en.wikiversity.org/wiki/Data_Structures_and_Algorith...
Or see the use of arrays in "Introduction to Algorithms", one of the standard textbooks about algorithms and data structures, the current edition being from 2022. There is no notion of arrays being resizable there.
Java, of course, calls its standard general-purpose list implementation both "array" and "list."
On that note, Swift is in the process of introducing a fixed-size array type which they intend to call “Vector”.