Contents

Preface

1 Fundamentals

1.1 Basic Programming Model

Primitive data types

Loops and conditionals

Arrays

Static methods

Recursion

APIs

Strings

Input and output

Binary search

1.2 Data Abstraction

Objects

Abstract data types

Implementing ADTs

Designing ADTs

1.3 Bags, Queues, and Stacks

APIs

Arithmetic expression evaluation

Resizing arrays

Generics

Iterators

Linked lists

1.4 Analysis of Algorithms

Running time

Computational experiments

Tilde notation

Order-ofgrowth classifications

Amortized analysis

Memory usage

1.5 Case Study: Union-Find

Dynamic connectivity

Quick find

Quick union

Weighted quick union

2 Sorting

2.1 Elementary Sorts

Rules of the game

Selection sort

Insertion sort

Shellsort

2.2 Mergesort

Abstract in-place merge

Top-down mergesort ...

Get Algorithms, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.