CS101-08a Trees Part 1

CS101-08a Trees Part 1 - CJD 08a Trees(Part 1 08a...

This preview shows pages 1–7. Sign up to view the full content.

CJD 08a Trees (Part 1) 08a Trees (Part 1) Fundamentals & Fundamentals & Traversals Traversals

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

View Full Document
CJD Trees Everywhere Family Trees Organizational Diagrams – Business and Politics Tournament Matches Diagram – Sports Parse Trees – Language Syntax / Compilers Expression Trees – Math computation Tree Diagrams for Counting – Statistics Decision Trees – Logic and Expert Systems Top-down and Bottom-up Diagrams – Analysis Java Class Hierarchy – Programming Folder/Subfolder Directory Structure – O/S
CJD Terminology Vertex – An object such as a node that can store data Edge – A connection or arc between two vertices Path – A list of distinct vertices with an edge connecting successive vertices. Number of edges is the path length . Tree – A set of vertices V and set of edges E such that there is a unique path between any two vertices. Root – A designated vertex Rooted Tree – A tree with a designated vertex as root. Forest – A collection of trees

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

View Full Document
CJD Recursive Definition of Trees A tree is either empty or a node connected to one vertex each from a set of trees A K E G H I N Ng O B S R U L M W T P Y D
CJD Terminology Issues Trees are encountered in many areas of study, primarily in Computer Science and Graph Theory There is no standard in defining terms – like “Tree”s. Some terms have conflicting definitions like complete trees, tree height, depth, level, etc. The key is to understand the concepts and be consistent with the definition of terms in each context. Always check the contextual definitions when terms are discussed.

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

View Full Document
CJD More Terminology … (1) Undirected Trees – Trees whose edges are undirected Directed Trees – Trees whose edges are in the direction always away from or always towards the root Vertex A is above or an ancestor of vertex B if A is along path from root to B, where A≠B. In this case, B is also below A or a descendant of A.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern