Immutable strings: implementations
Represent a string by its length n together with an array of exactly n characters, e.g.:
- Or represent a string by its length n together with an SLL of characters, e.g.:
- The array representation is much better. Since these strings are immutable, we never insert or delete characters.