Additional Topics

  • Antti LaaksonenEmail author
Part of the Undergraduate Topics in Computer Science book series (UTICS)


This final chapter presents a selection of advanced algorithms and data structures. Mastering the techniques of this chapter may sometimes help you to solve the most difficult problem in a programming contest. Section 15.1 discusses square root techniques for creating data structures and algorithms. Such solutions are often based on the idea of dividing a sequence of n elements into \(O(\sqrt{n})\) blocks, each of which consists of \(O(\sqrt{n})\) elements. Section 15.2 further explores the possibilities of segment trees. For example, we will see how to create a segment tree that supports both range queries and range updates at the same time. Section 15.3 presents the treap data structure which allows us to efficiently split an array into two parts and combine two arrays into a single array. Section 15.4 focuses on optimizing dynamic programming solutions. First we will learn the convex hull trick which is used with linear functions, and after this we will discuss the divide and conquer optimization and Knuth’s optimization. Section 15.5 deals with miscellaneous algorithm design techniques, such as meet in the middle and parallel binary search.

Copyright information

© Springer International Publishing AG 2017

Authors and Affiliations

  1. 1.Department of Computer ScienceUniversity of HelsinkiHelsinkiFinland

Personalised recommendations