Chapter 5. The Dance with Trees

Everything from creating simple binary trees to practical applications such as Huffman encoding is covered in this section:

  • Defining a binary tree data type
  • Defining a rose tree (multiway tree) data type
  • Traversing a tree depth-first
  • Traversing a tree breadth-first
  • Implementing a Foldable instance for a tree
  • Calculating the height of a tree
  • Implementing a binary search tree data structure
  • Verifying the order property of a binary search tree
  • Using a self-balancing tree
  • Implementing a min-heap data structure
  • Encoding a string using a Huffman tree
  • Decoding a Huffman code

Introduction

Introduction

Trees are a common data structure used in a variety ...

Get Haskell Data Analysis Cookbook 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.