Swipe to navigate through the chapters of this book
This chapter highlights the important role of data structures as a natural companion to algorithms. The premise is that computers can only store and operate on primitive data types, which essentially means just numbers; if we need another data type (e.g., to represent an image, or an email), we need to design it ourselves by enforcing a format on numerical data.
The running example used is that of strings, which in theory are just sequences of characters. Faced with a practical need to represent strings in memory however, a range of options exist. By examining two different string data structures and a range of algorithms that operate on them, various trade-offs in terms of efficiency are highlighted: ultimately, what seem be subtle or unimportant differences have a major impact.
Please log in to get access to this content
To get access to this content you need the following product:
The second option is sometimes termed ASCIIZ which sort of reads as “zero-terminated ASCII”.
- How Long Is a Piece of String?
- Springer International Publishing
- Sequence number
- Chapter number