day20 - COP 3503 Computer Science II CLASS NOTES - DAY #20...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
COP 3503 – Computer Science II CLASS NOTES - DAY #20 The last couple of day’s notes have introduced special case of the binary tree known as the binary search tree (BST) and the self-balancing search tree known as the AVL tree. General search trees are special cases of M-way trees (sometimes also referred to as multiway trees ). Some of the variants of m-way trees are beyond the scope of this course, however one special variant is not and that is the variant which is called the m-way search tree . There are many different variants and we will examine only one of these special trees, the B-tree, and a particularly suitable application for this data structure. M-way search trees play the same role amongst general trees that binary search trees play among binary trees, and they are used for exactly the same purpose: fast information retrieval and update. The problems in dealing with m-way search trees are similar to those experienced with BSTs. Balancing problems are more critical in general trees since there is a potential for many subtrees. Shown below is an example of an m-way search tree, this one happens to be a 4-way search tree. Day 20 - 1 Beyond Binary Search Trees M-way Search Tree (Mutliway Search Tree) A multiway search tree T is a general tree in which an ordering is imposed on the set of keys which reside in each node such that: 1. Each node has m children and m-1 keys. 2. The keys in each node appear in ascending order. 3. The keys in the first I children are smaller than the i th key. 4. The keys in the last m-1 children are larger than the i th key.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4-way search tree The Reasons for M-way Search Trees One common application for m-way search trees is the file system for secondary memory, such as disks and tapes, on computer systems. The basic unit of I/O transfer associated with a disk is a block. When information is read from a disk, the entire block, in which the information required is contained, is read into the memory (main memory) and when information is written from the main memory back to the secondary memory (the disk), the entire block is written back. Each time information is requested from a disk, the information must be located on the disk, the read/write head on the disk must be correctly positioned above the portion of the disk where the information is located, and the system must wait for the spinning disk to rotate the entire required block underneath the read/write head to be transferred to the main memory. This would indicate that there are several time factors involved with every request for information from the secondary memory, which are: access time = seek time + latency + transfer time where, seek time represents the time required to properly position the read/write head; latency refers to the rotational delay required to spin the disk to the proper position under the read/write head; and transfer time refers to the total time required to move the disk block into the main memory. Compared to transferring Day 20 - 2 50 60 80 30 35 58 59 52 54 61 62 55 56 57 100 63 70 73
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 06/12/2011.

Page1 / 13

day20 - COP 3503 Computer Science II CLASS NOTES - DAY #20...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online