Book contents
- Frontmatter
- Dedication
- Contents
- Preface
- 1 Introduction
- 2 A Warm-up
- 3 Random Sampling
- 4 List Ranking
- 5 Sorting Atomic Items
- 6 Set Intersection
- 7 Sorting Strings
- 8 The Dictionary Problem
- 9 Searching Strings by Prefix
- 10 Searching Strings by Substring
- 11 Integer Coding
- 12 Statistical Coding
- 13 Dictionary-Based Compressors
- 14 Block-Sorting Compression
- 15 Compressed Data Structures
- 16 Conclusion
- Index
2 - A Warm-up
Published online by Cambridge University Press: 08 June 2023
- Frontmatter
- Dedication
- Contents
- Preface
- 1 Introduction
- 2 A Warm-up
- 3 Random Sampling
- 4 List Ranking
- 5 Sorting Atomic Items
- 6 Set Intersection
- 7 Sorting Strings
- 8 The Dictionary Problem
- 9 Searching Strings by Prefix
- 10 Searching Strings by Substring
- 11 Integer Coding
- 12 Statistical Coding
- 13 Dictionary-Based Compressors
- 14 Block-Sorting Compression
- 15 Compressed Data Structures
- 16 Conclusion
- Index
Summary
This chapter deals with a classic educational problem, called the subarray sum. The specialty of this problem is that it has a simple formulation, which finds other useful variations and applications, and it admits a sequence of algorithmic solutions of increasing sophistication and elegance, which imply a significant reduction in their time and I/O complexities. Te ultimate result is a linear-time and -I/O algorithm, which will allow the reader to enter into the “game” of time and I/O complexity evaluations. The chapter concludes with a discussion of some interesting variations of this problem which arise from computational biology applications, and admit no immediate algorithmic solutions, thus stressing the fact that “ five minutes thinking” is not enough for designing efficient algorithms.
- Type
- Chapter
- Information
- Pearls of Algorithm Engineering , pp. 10 - 22Publisher: Cambridge University PressPrint publication year: 2023