Dictionaries and their Implementation: Binary Trees, ...

(辞書とその実装: 二分木など)

Data Structures and Algorithms

8th lecture, November 5, 2015

http://www.sw.it.aoyama.ac.jp/2015/DA/lecture8.html

Martin J. Dürst

AGU

© 2009-15 Martin J. Dürst 青山学院大学

Today's Schedule

 

Summary of Last Lecture

 

Report: Manual Sorting

Deadline: November 4th, 2015 (Wednesday), 19:00.

Problem: Propose and describe an algorithm/algorithms for manual sorting, for the following two cases:

  1. One person sorts 6000 pages
  2. 20 people together sort 60000 pages

Each page is a sheet of paper of size A4, where a 10-digit number is printed in big letters.

The goal is to sort the pages by increasing number. There is no knowledge about how the numbers are distributed.

You can use the same algorithm for both cases, or a different algorithm.

Details:

 

Problems Seen in Reports

Sorting Faster than O(n log n)

Bin Sort

(also called bucket sort)

Example: Sorting by student number

Radix Sort

Parallelization of Sorting

The Dictionary ADT

(caution: Not exactly the same as a (book) dictionary)

 

Simple Dictionary Implementations

 

Binary Tree

 

Traversal Methods for Binary Trees

 

Binary Search Tree

(definition/invariants)

 

Search in a Search Tree

 

Insertion into a Search Tree

 

Deletion from a Search Tree

 

Implementation of Search Tree

 

Evaluation of Simple Search Tree

 

Balanced Trees

Solution: A tree that is to some degree (but not perfectly) balanced

 

Top-down 2-3-4 Tree

 

Summary

 

Homework

(no need to submit)

 

Glossary

bin sort
ビンソート
most significant digit
最上位の桁
radix sort
基数整列
balanced tree
平衡木
traversal method
辿り方
binary search tree
二分探索木
balanced tree
平衡木
hashing
ハッシュ法
binary tree
二分木
parallelization
並列化
depth first
深さ優先
preorder
行きがけ順
inorder
通りがけ順
postorder
帰りがけ順
breadth first
幅優先
key
キー、鍵
implementation-dependent
実装依存
top-down 2-3-4 tree
トップダウン 2-3-4 木