Balanced Search Trees, Tries, and Skip Lists (Discussion 11) (Cây tìm kiếm cân bằng) - Christine Zhou
正在生成预览...
Slide bài giảng thảo luận về cây tìm kiếm cân bằng, trie và skip list.
描述
Discussion 11: Balanced Search Trees, Tries, and Skip Lists Christine Zhou Agenda Announcements Balanced Search Tree Review Problem 1 Tries Review Problem 2 Skip Lists Review Problem 3 Announcements Midterm grades released! You can submit regrades for a week, but we will not be accepting them at all afterwards! Want to vent? Do you have comments/criticisms about the course? tinyurl.com/placetovent Advising sessions are available at tinyurl.com/cs61b-advising Feel free to email me if you would like to schedule a time! Extra project OH Monday 6-8PM in 273/275 Soda Wednesday 6-8PM in 271/273 Soda No office hours on Friday Project milestone due Monday! Project 2 due Thursday! Discussion survey: tinyurl.com/czdisc11 Balanced Search Trees Bushy was better than spindly trees in terms of runtime 2-3-4 Trees! (also called 2-4 Trees) Should still follow the BST property (less on the left, greater on the right) Each node contains 1-3 elements with 2-4 children nodes If we want to insert an element, we’ll traverse and put it in the corresponding leaf node It’s possible that it will have more than 3 elements Split the node, picking either of the middle elements to send up, this can happen recursively Try inserting 7 and 27 into our 2-4 Tree! Red-Black Trees A binary tree that colors nodes red and black Any red nodes are in the same B-Tree node as its parent Constraints: 1. Each node is (conceptually) colored red or black. 2. Root is black. 3. Every leaf node contains no data (null) and is black. This simplifies the algorithms a little bit. 4. Every leaf has same number of black ancestors. 5. Every internal node has two children. 6. Every red node has two black children. Left-Leaning Red Black Trees We can represent nodes with two elements in two ways Let’s just say that we’ll pick the left representation If we are trying to represent a node with two elements, the red node will be “left leaning” 1 Balanced Search Trees a)
AI 摘要
- 文档名称
- Balanced Search Trees, Tries, and Skip Lists (Discussion 11) (Cây tìm kiếm cân bằng) - Christine Zhou
- 学校 / 课程
- University of California, Berkeley · Lập trình Java
- 内容
- Tài liệu thảo luận về Cây tìm kiếm cân bằng (2-4 Trees, Red-Black Trees), Tries và Skip Lists. Bao gồm ôn tập lý thuyết và các bài tập thực hành liên quan đến việc chuyển đổi, chèn và tìm kiếm trên các cấu trúc này.
- 目录
- Agenda
- Announcements
- Balanced Search Trees Review
- Problem 1
- Tries Review
- Problem 2
- Skip Lists Review
- Problem 3
- 页数
- 12 页
- 上传者
- Uni24h
常见问题
此文档免费吗?
是的。“Balanced Search Trees, Tries, and Skip Lists (Discussion 11) (Cây tìm kiếm cân bằng) - Christine Zhou”是免费的 — 只需登录并点击“下载”即可获取原始文件。
这份文档有多少页?
该文档共有 12 页,适用于课程 Lập trình Java。您可以在下载前进行在线预览。
我可以在下载前预览吗?
是的。您可以通过在线阅读器直接在本页面预览此文档,然后再决定是否下载。
Balanced Search Trees, Tries, and Skip Lists (Discussion 11) (Cây tìm kiếm cân bằng) - Christine Zhou
正在生成预览...
Discussion 11: Balanced Search Trees, Tries, and Skip Lists Christine Zhou Agenda Announcements Balanced Search Tree Review Problem 1 Tries Review Problem 2 Skip Lists Review Problem 3 Announcements Midterm grades released! You can submit regrades for a week, but we will not be accepting them at all afterwards! Want to vent? Do you have comments/criticisms about the course? tinyurl.com/placetovent Advising sessions are available at tinyurl.com/cs61b-advising Feel free to email me if you would like to schedule a time! Extra project OH Monday 6-8PM in 273/275 Soda Wednesday 6-8PM in 271/273 Soda No office hours on Friday Project milestone due Monday! Project 2 due Thursday! Discussion survey: tinyurl.com/czdisc11 Balanced Search Trees Bushy was better than spindly trees in terms of runtime 2-3-4 Trees! (also called 2-4 Trees) Should still follow the BST property (less on the left, greater on the right) Each node contains 1-3 elements with 2-4 children nodes If we want to insert an element, we’ll traverse and put it in the corresponding leaf node It’s possible that it will have more than 3 elements Split the node, picking either of the middle elements to send up, this can happen recursively Try inserting 7 and 27 into our 2-4 Tree! Red-Black Trees A binary tree that colors nodes red and black Any red nodes are in the same B-Tree node as its parent Constraints: 1. Each node is (conceptually) colored red or black. 2. Root is black. 3. Every leaf node contains no data (null) and is black. This simplifies the algorithms a little bit. 4. Every leaf has same number of black ancestors. 5. Every internal node has two children. 6. Every red node has two black children. Left-Leaning Red Black Trees We can represent nodes with two elements in two ways Let’s just say that we’ll pick the left representation If we are trying to represent a node with two elements, the red node will be “left leaning” 1 Balanced Search Trees a)
阅读全文
- 文档名称
- Balanced Search Trees, Tries, and Skip Lists (Discussion 11) (Cây tìm kiếm cân bằng) - Christine Zhou
- 学校 / 课程
- University of California, Berkeley · Lập trình Java
- 内容
- Tài liệu thảo luận về Cây tìm kiếm cân bằng (2-4 Trees, Red-Black Trees), Tries và Skip Lists. Bao gồm ôn tập lý thuyết và các bài tập thực hành liên quan đến việc chuyển đổi, chèn và tìm kiếm trên các cấu trúc này.
- 目录
- Agenda
- Announcements
- Balanced Search Trees Review
- Problem 1
- Tries Review
- Problem 2
- Skip Lists Review
- Problem 3
- 页数
- 12 页
- 上传者
- Uni24h
评论 (0)
暂无评论。快来抢沙发吧!
Misc.onclusion (Discussion 14-END) (Ôn tập cấu trúc dữ liệu) - Christine Zhou
Final Review Solutions (Cấu trúc dữ liệu heap, hàng đợi ưu tiên và duyệt đồ thị) - Ching and Christines
Giáo trình Lập trình Java
Inheritance (Discussion 4) (Kế thừa trong Java) - Christine Zhou
Asymptotic Analysis (Discussion 7) (Phân tích tiệm cận) - Christine Zhou
Chương 7.Cơ học lượng tử - Vật lý đại cương 3 - TS.Nguyễn Thị Trang
Chương 6.Quang học lượng tử - Vật lý đại cương 3 - TS.Nguyễn Thị Trang
Chương 5.Thuyết tương đối - Vật lý đại cương 3 - TS.Nguyễn Thị Trang
Chương 4. Tán xạ ánh sáng - Vật lý đại cương 3 - TS.Nguyễn Thị Trang
Chương 3.Phân cực ánh sáng - Vật lý đại cương 3 - TS.Nguyễn Thị Trang
评论 (0)
暂无评论。快来抢沙发吧!