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.
Đang tạo bản xem trước...
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)
… Tải file gốc để đọc toàn bộ tài liệu.
- Tên tài liệu
- Balanced Search Trees, Tries, and Skip Lists (Discussion 11) (Cây tìm kiếm cân bằng) - Christine Zhou
- Trường / Môn
- University of California, Berkeley · Lập trình Java
- Nội dung
- 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.
- Mục lục
- Agenda
- Announcements
- Balanced Search Trees Review
- Problem 1
- Tries Review
- Problem 2
- Skip Lists Review
- Problem 3
- Doc.pages
- 12 trang
- Người đăng
- Giang Le
Câu hỏi thường gặp
Tài liệu này có miễn phí không?
Có. “Balanced Search Trees, Tries, and Skip Lists (Discussion 11) (Cây tìm kiếm cân bằng) - Christine Zhou” miễn phí — bạn chỉ cần đăng nhập rồi bấm Tải xuống để lấy file gốc.
Tài liệu dài bao nhiêu trang?
Tài liệu gồm 12 trang, thuộc môn Lập trình Java. Bạn có thể xem trước online trước khi tải.
Tôi có thể xem trước trước khi tải không?
Có. Bạn xem trước tài liệu ngay trên trang này bằng trình đọc online, rồi quyết định tải về.

Bình luận (0)
Chưa có bình luận nào. Hãy là người đầu tiên!