当前位置:网站首页>CPT 102_ LEC 20
CPT 102_ LEC 20
2022-06-11 02:50:00 【NONE_ WHY】
1. Tree
1.1. Introduction to Trees
1.1.1. Basic
- Used for non-linear data structures
- Family trees
- Organisational charts
- Trees offer an alternative
- Representation
- Implementation strategy
- Set of algorithms
1.1.2. Binary Tree
- A binary tree
- empty
- a root node together with two binary trees
- left subtree
- right subtree
1.1.3. What is a tree exactly?
- Models the parent/child relationship between different elements
- Each child only has one parent
- Each parent has ? children
- From mathematics
- A “Directed Acyclic Graph”【 Directed acyclic graph 】 (DAG)
- At most one path from any one node to any other node
1.1.4. Some Concepts
- Level --> Equivalent to the “row” that a value is in
- Depth --> The number of levels in the tree
- Leaf Nodes --> A node with no children
- Non-leaf Nodes
- Balanced --> All leaf nodes are on levels n and (n+1), for some value of n
1.1.5. How many types of tree are there?
- Examples
- Red-Black Tree
- AVL Tree
- ...
- Different types are used for different things
- To improve speed
- To improve the use of available memory
- To suit particular problems
1.1.6. Trees and Recursion
- Recursively defined data structure
- Recursion is very natural for trees – important!
- Recursion tree
- If you don’t use recursion then use iteration
1.1.7. What is a tree useful for?
- Artificial Intelligence
- planning
- navigating
- games
- Representing things
- Simple file systems
- Class inheritance and composition
- Classification
- HTML pages
- Parse trees for languages
- Essential in compilers like Java, C# etc
- 3D graphics (e.g. BSP trees)
1.1.8. Some Example
- Tic Tac Toe【 Jingzi chess 】
- N-Queen【N Queen 】
- Decision Tree
1.1.9. Conclusion
- Data representation of tree is important
- Efficiently adding, accessing and removing data from a tree is important
- Trees can be made efficient and help you organise data
- Trees are useful in
- Computer graphics
- Artificial Intelligence
- Databases
边栏推荐
- Wechat template message errCode ": 40165," errmsg ":" invalid web pagepath
- When a logical deletion encounters a unique index, what are the problems and solutions?
- AOSP ~ 修改默认音量
- 你的公司会选择开发数据中台吗?
- 剑指 Offer II 079. 所有子集
- Will your company choose to develop data center?
- Why did those who left Beijing, Shanghai and Guangzhou with a smile cry in the end?
- AOSP ~ modify WebView default implementation
- AOSP ~ Logcat Chatty 行过期
- Cmake common commands
猜你喜欢

Manon's advanced road - Daily anecdotes

2022年熔化焊接与热切割操作证考试题库及答案

逃离大城市的年轻人:扛住了房价和压力,没扛住流行病

How to add two factor authentication for WordPress websites

从绿联冲刺IPO,看手机配件市场沉浮录

Win10 安装Office 2016出现错误代码30204-44怎么处理?

How can Delma's own brand "take off" when Philips is listed on the market?

mysql重装时写my.ini配置文件出错

AOSP ~ 修改WebView默认实现

软件测试英语常见词汇
随机推荐
AOSP - Developer mode is enabled by default
AOSP ~ 修改默认音量
近期学习和更新计划
Necessity for banks to choose electronic bidding procurement
Stc8a8k64d4 EEPROM read / write failure
【斐波那契数列】
[C language classic]: inverted string
Link list of high frequency written interview question brushing summary (distribution explanation & code annotation)
软件测试英语常见词汇
[interview question 17.04. missing numbers]
How to fix syntax errors in WordPress websites
Will your company choose to develop data center?
[189. rotation array]
Wechat applet
求MySQL先按大于等于当前时间升序排序,再按小于当前时间降序排序
ShaderGraphs
RS232/RS485转4G DTU 上传基于Modbus协议的温湿度传感器数据到远程TCP服务器
Sword finger offer II 079 All subsets
扁平数据转tree与tree数据扁平化
6 best WordPress Image optimizer plug-ins to improve WordPress website performance