Balanced Search Trees, Tries, and Skip Lists (Discussion 11) (Cây tìm kiếm cân bằng) - Christine Zhou
Generating preview...
Slide bài giảng thảo luận về cây tìm kiếm cân bằng, trie và skip list.
Description
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 summary
- Document name
- Balanced Search Trees, Tries, and Skip Lists (Discussion 11) (Cây tìm kiếm cân bằng) - Christine Zhou
- School / Course
- University of California, Berkeley · Lập trình Java
- Content
- 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.
- Table of contents
- Agenda
- Announcements
- Balanced Search Trees Review
- Problem 1
- Tries Review
- Problem 2
- Skip Lists Review
- Problem 3
- Pages
- 12 pages
- Uploaded by
- Uni24h
Frequently asked questions
Is this document free?
Yes. “Balanced Search Trees, Tries, and Skip Lists (Discussion 11) (Cây tìm kiếm cân bằng) - Christine Zhou” is free — just sign in and click Download to get the original file.
How many pages is this document?
The document has 12 pages, for the course Lập trình Java. You can preview it online before downloading.
Can I preview before downloading?
Yes. You can preview this document right on this page with the online reader, then decide whether to download.
Balanced Search Trees, Tries, and Skip Lists (Discussion 11) (Cây tìm kiếm cân bằng) - Christine Zhou
Generating preview...
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)
Read full document
- Document name
- Balanced Search Trees, Tries, and Skip Lists (Discussion 11) (Cây tìm kiếm cân bằng) - Christine Zhou
- School / Course
- University of California, Berkeley · Lập trình Java
- Content
- 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.
- Table of contents
- Agenda
- Announcements
- Balanced Search Trees Review
- Problem 1
- Tries Review
- Problem 2
- Skip Lists Review
- Problem 3
- Pages
- 12 pages
- Uploaded by
- Uni24h
Comments (0)
No comments yet. Be the first!
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
Comments (0)
No comments yet. Be the first!