Computer Algorithms II Lecture Notes

20 November 2007 • Trees


Outline

  • Motivation

  • Tree properties.

  • Tree data structures.

  • Tree implementations.

  • Extension and details.

a tree

Linked Lists

Fast Interior Access

Fast-Access Structure

Trees

Node Relations

Tree Properties

Tree Data Structure

Implementing Trees

Tree Implementation

Dynamic Implementation

Trees And Recursion

Binary Tree Operations

Binary-Tree Search

Binary-Tree Add

Removing Nodes

Binary-Tree Remove

Operation Performance

Binary Trees and Order

Binary Search Trees

Binary Search Tree Member

Binary Search Tree Add

Removing Nodes

Binary Search Tree Remove

node * remove(node * r)

  if r.left ≠ nil
    r.left = remove_max(r.left, r.data)

  or r.right ≠ nil
    r.right = remove_min(r.right, r.data)

  or
    delete r
    r = nil

  return r

Performance

Summary

References


This page last modified on 24 February 2006.

This work's CC license.