1 / 14

Chapter 7

Chapter 7. Multiway trees. A tree was defined as either an empty structure or a structure whose children are disjoint trees. This means that each node in some kind of trees can have more than two children. This tree is called a multiway tree of order m , or m-way tree

elu
Télécharger la présentation

Chapter 7

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 7 Multiway trees

  2. A tree was defined as either an empty structure or a structure whose children are disjoint trees. • This means that each node in some kind of trees can have more than two children. • This tree is called a multiway tree of order m, or m-way tree • A multiway search tree of order m is a multiway tree in which : • Each node has m children and m-1 keys. • The keys in each node are in ascending order. • The keys in the first i children are smaller than the ith key. • The keys in the last m-i children are larger than the ith key.

  3. B-Tree • B- Trees operates closely with secondary storage. • Property: the size of a node can be made as large as a block. • A B- tree of order m is a multi way search tree with the following properties: • The root has at least two subtrees unless it is a leaf. • Each nonroot and each nonleaf node holds k-1 keys and k pointers to subtrees where [m/2] ≤ k ≤ m. • Each leaf node holds k-1 keys where [m/2] ≤ k ≤ m. • All leaves are usually on the same level.

  4. Chapter 8 Graphs

  5. Even though trees are flexible and have many applications, they have one limitation: • They can only represent relations of hierarchical type, such as relations between parent and child. • Other relations are only represented indirectly. • Graph, a generalization of a tree, is a data structure that contain a collection of vertices( or nodes) and the connections between them.

  6. Terminology • Graph • collection of nodes (vertices) • collection of line segments connecting vertices (edges) • Graph • Directed • Each line segment has a direction (Arc) • Undirected • No direction on any line segment (Edge)

  7. Neighbors • Two vertices are said to be neighbors if an edge directly connects them • Path • A sequence of vertices in which each vertex is adjacent to the other • Cycle • A path that start and ends with the same vertex • Loop • A single Arc that begins and ends with the same vertex

  8. Connected Graph • There is a path from any vertex to any other vertex • Vertex Degree • Indegree • Number of arcs entering the vertex • Outdegree • Number of arcs leaving the vertex

  9. Storage Structures Two sets Vertices Edges Two Representations Arrays (Adjacency Matrix) Linked Lists (Adjacency List)

More Related