Tree Traversals, Tries, KD Trees (Discussion 9) (Các phép duyệt cây) - Christine Zhou
Génération de l'aperçu...
Tài liệu thảo luận về các phép duyệt cây, Trie, và cây K-D, bao gồm lý thuyết và bài tập thực hành.
Description
Discussion 9: Tree Traversals, Tries, K-D Trees Christine Zhou Agenda K-D Tree review (with demos from lecture) K-D Tree problems Tree Traversal review Tree Traversal problems Trie review Trie problems Announcements Project 2B is due on Saturday, March 23 at 11:59pm. Remember that these are real deadlines (not "checkpoints") Midterm 2 is on April 5th from 8-10pm. Here are some events to keep on your radar! Check out Hug’s updated kd-tree nearest video @3426 Course Staff Guerrilla Section - 3/31 12-2PM Soda Labs HKN Review Session - 3/31 3-6PM HP Auditorium CSM Review Session - 4/1 6-9PM HP Auditorium Discussion survey: tinyurl.com/cz-disc9-sp19 Tree Traversals Level-Order/Breadth First Search (BFS): ○ Visit top to bottom, left to right, just like how you read! Depth-order/Depth First Search (DFS): ○ Traverse “deeper” nodes before shallow ones Types of DFS: Preorder Pre-Order: “Visit” a node, then traverse its children preOrder(BSTNode x) { if (x == null) return; print(x.key) preOrder(x.left) preOrder(x.right) } Pre-Order: DBACFEG Hack: draw “pegs” on the left side of each node and take a walk around the edges of the tree. The Preorder is the order in which you hit the pegs Types of DFS: Inorder In-Order: Traverse left child, “visit” node, then traverse right child inOrder(BSTNode x) { if (x == null) return; inOrder(x.left) print(x.key) inOrder(x.right)} In-Order: ABCDEFG Hack: draw “pegs” on the bottom of each node and take a walk around the edges of the tree. The Inorder is the order in which you hit the pegs Types of DFS: Postorder Post-Order: Traverse children, then “visit” node. postOrder(BSTNode x) { if (x == null) return; postOrder(x.left) postOrder(x.right) print(x.key) } Post-Order: ACBEGFD Hack: draw “pegs” on the right side of each node and take a walk around the edges of the tree. The postorder is the order in which you hit the pegs Problem 1.1
Résumé IA
- Nom du document
- Tree Traversals, Tries, KD Trees (Discussion 9) (Các phép duyệt cây) - Christine Zhou
- École / Cours
- University of California, Berkeley · Lập trình Java
- Contenu
- Tài liệu này cung cấp kiến thức ôn tập và bài tập thực hành về K-D Tree, các phương pháp duyệt cây (BFS, DFS: Preorder, Inorder, Postorder) và cấu trúc dữ liệu Trie. Các khái niệm được giải thích rõ ràng kèm ví dụ và mẹo ghi nhớ, cùng với lời giải cho các bài tập.
- Table des matières
- Agenda
- Announcements
- Tree Traversals
- Types of DFS: Preorder
- Types of DFS: Inorder
- Types of DFS: Postorder
- Problem 1.1
- Solution
- Tries
- Runtime of Tries
- Problem 2.1
- Solutions
- Pages
- 65 pages
- Téléversé par
- Uni24h
Foire aux questions
Ce document est-il gratuit ?
Oui. « Tree Traversals, Tries, KD Trees (Discussion 9) (Các phép duyệt cây) - Christine Zhou » est gratuit — il suffit de vous connecter et de cliquer sur Télécharger pour obtenir le fichier original.
Combien de pages compte ce document ?
Le document contient 65 pages, pour le cours Lập trình Java. Vous pouvez le prévisualiser en ligne avant de le télécharger.
Puis-je prévisualiser avant de télécharger ?
Oui. Vous pouvez prévisualiser ce document directement sur cette page avec le lecteur en ligne, puis décider de le télécharger ou non.
Tree Traversals, Tries, KD Trees (Discussion 9) (Các phép duyệt cây) - Christine Zhou
Génération de l'aperçu...
Discussion 9: Tree Traversals, Tries, K-D Trees Christine Zhou Agenda K-D Tree review (with demos from lecture) K-D Tree problems Tree Traversal review Tree Traversal problems Trie review Trie problems Announcements Project 2B is due on Saturday, March 23 at 11:59pm. Remember that these are real deadlines (not "checkpoints") Midterm 2 is on April 5th from 8-10pm. Here are some events to keep on your radar! Check out Hug’s updated kd-tree nearest video @3426 Course Staff Guerrilla Section - 3/31 12-2PM Soda Labs HKN Review Session - 3/31 3-6PM HP Auditorium CSM Review Session - 4/1 6-9PM HP Auditorium Discussion survey: tinyurl.com/cz-disc9-sp19 Tree Traversals Level-Order/Breadth First Search (BFS): ○ Visit top to bottom, left to right, just like how you read! Depth-order/Depth First Search (DFS): ○ Traverse “deeper” nodes before shallow ones Types of DFS: Preorder Pre-Order: “Visit” a node, then traverse its children preOrder(BSTNode x) { if (x == null) return; print(x.key) preOrder(x.left) preOrder(x.right) } Pre-Order: DBACFEG Hack: draw “pegs” on the left side of each node and take a walk around the edges of the tree. The Preorder is the order in which you hit the pegs Types of DFS: Inorder In-Order: Traverse left child, “visit” node, then traverse right child inOrder(BSTNode x) { if (x == null) return; inOrder(x.left) print(x.key) inOrder(x.right)} In-Order: ABCDEFG Hack: draw “pegs” on the bottom of each node and take a walk around the edges of the tree. The Inorder is the order in which you hit the pegs Types of DFS: Postorder Post-Order: Traverse children, then “visit” node. postOrder(BSTNode x) { if (x == null) return; postOrder(x.left) postOrder(x.right) print(x.key) } Post-Order: ACBEGFD Hack: draw “pegs” on the right side of each node and take a walk around the edges of the tree. The postorder is the order in which you hit the pegs Problem 1.1
Lire le document entier
- Nom du document
- Tree Traversals, Tries, KD Trees (Discussion 9) (Các phép duyệt cây) - Christine Zhou
- École / Cours
- University of California, Berkeley · Lập trình Java
- Contenu
- Tài liệu này cung cấp kiến thức ôn tập và bài tập thực hành về K-D Tree, các phương pháp duyệt cây (BFS, DFS: Preorder, Inorder, Postorder) và cấu trúc dữ liệu Trie. Các khái niệm được giải thích rõ ràng kèm ví dụ và mẹo ghi nhớ, cùng với lời giải cho các bài tập.
- Table des matières
- Agenda
- Announcements
- Tree Traversals
- Types of DFS: Preorder
- Types of DFS: Inorder
- Types of DFS: Postorder
- Problem 1.1
- Solution
- Tries
- Runtime of Tries
- Problem 2.1
- Solutions
- Pages
- 65 pages
- Téléversé par
- Uni24h
Commentaires (0)
Aucun commentaire pour le moment. Soyez le premier !
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
Commentaires (0)
Aucun commentaire pour le moment. Soyez le premier !