Data Journey

International Studies Grad. racing for AI Engineer

Download as .zip Download as .tar.gz View on GitHub
20 December 2020

Non-Linear Data Structure: Tree

by mervyn

Tree

A collection of nodes to represent a hierarchical relationship

Trees

trees

All nodes will have zero or more child nodes or children

Leaf and Internal Nodes

leaf

Unordered & Ordered

unordered

Paths

paths

A path is a sequence of nodes (\(a_{0}\), \(a_{2}\), … , \(a_{n}\)), where \(a_{k+1}\) is a child of \(a_{k}\).

Depth

depth

For each node in a tree, there exists a unique path from the root node to that node.

Height

height

The height of a tree is defined as the maximum depth of any node within the tree

Ancestor and Descendant

Example

ansc

Representation

List representation for child nodes (e.g.: linked list)

source “K-MOOC 허재필 교수님의 <인공지능을 위한 알고리즘과 자료구조: 이론, 코딩, 그리고 컴퓨팅 사고> 강좌의 3-1 강좌의 트리 자료구조 중(http://www.kmooc.kr/courses/course-v1:SKKUk+SKKU_46+2020_T1)”

back next

tags:

Comments

Post comment
Loading...

Share this: