Skip to main content

How Long Is a Piece of String?

  • Chapter
What Is Computer Science?

Part of the book series: Undergraduate Topics in Computer Science ((UTICS))

  • 3283 Accesses

Abstract

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 16.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    The second option is sometimes termed ASCIIZ which sort of reads as “zero-terminated ASCII”.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this chapter

Cite this chapter

Page, D., Smart, N. (2014). How Long Is a Piece of String?. In: What Is Computer Science?. Undergraduate Topics in Computer Science. Springer, Cham. https://doi.org/10.1007/978-3-319-04042-4_4

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-04042-4_4

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-04041-7

  • Online ISBN: 978-3-319-04042-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics