Weighted Quick Union và HashMaps (Discussion 14) - Christine Zhou
Generating preview...
Tài liệu thảo luận số 14, bao gồm thông báo, bài tập về Weighted Quick Union và HashMaps, cùng tổng quan các khóa học CS tại UC Berkeley.
Description
Discussion 14: Misc.onclusion Christine Zhou Agenda Announcements Worksheet CS Courses Overview Optional: Interview Question Tips Announcements Cookies!! HW8 due Friday 12/1 Proj3 due Wednesday 12/6 Tentative plan for dead week: No discussion OH as normal Lab will be converted to topic based review Design! Weighted Quick Union with Path Compression Used to represent connectivity between items Each item belongs to its own set, “union” the items together by connecting the sets together Sets will have a tree like structure Optimizations: Union by weight: connect the root of the “lighter” set to the root of the “heavier” set (determined by number of nodes in the set) Path compression: when you “find” a node, compress the node and the path to the node by connecting it to the root of the set 61BL Lab about Disjoint Sets HashMaps Use an array to represent your data For each key-value pair, assign each key a “hash code” mod (%) the hash code by the length of the array (this gives you a number between 0 and array.length - 1), use this as the index! N = num elements, M = num buckets, C = some constant If N/M > C, then increase M! N/M is called the load factor If we have multiple elements that go to same place in the array, usually we will keep track of a list Be careful about negative numbers when modding! This is called external chaining What is the runtime of .contains and .insert? Course Overview (Personal experiences) CS61C: Machine Structures C, assembly language Learn about how computers work! Caching, MapReduce, parallelism CS170: Algorithms CS70: Discrete Math/Probability Proofs for things we’ve seen so far Problem set every week Stable marriage, modular arithmetic, graph theory, etc. CS186: Databases Learn SQL and how databases keep track of all your data, Java “Chill”, though exam was tough this time around…, some projects Guest speakers from the industry Learn to analyze runtimes,
AI summary
- Document name
- Weighted Quick Union và HashMaps (Discussion 14) - Christine Zhou
- School / Course
- University of California, Berkeley · Lập trình Java
- Content
- Buổi thảo luận cuối cùng này cung cấp thông báo về bài tập, dự án và kế hoạch tuần cuối. Tài liệu cũng giới thiệu chi tiết về các khóa học Khoa học Máy tính khác nhau và các khái niệm kỹ thuật như Weighted Quick Union và HashMaps.
- Table of contents
- Agenda
- Announcements
- Design!
- Weighted Quick Union with Path Compression
- HashMaps
- Course Overview (Personal experiences)
- Course Overviews (16x)
- Course Overviews (16x) cont.
- Course Overview (17x)
- Course Overview (18x)
- Course Overview (other)
- Pages
- 18 pages
- Uploaded by
- Uni24h
Frequently asked questions
Is this document free?
Yes. “Weighted Quick Union và HashMaps (Discussion 14) - Christine Zhou” is free — just sign in and click Download to get the original file.
How many pages is this document?
The document has 18 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.
Weighted Quick Union và HashMaps (Discussion 14) - Christine Zhou
Generating preview...
Discussion 14: Misc.onclusion Christine Zhou Agenda Announcements Worksheet CS Courses Overview Optional: Interview Question Tips Announcements Cookies!! HW8 due Friday 12/1 Proj3 due Wednesday 12/6 Tentative plan for dead week: No discussion OH as normal Lab will be converted to topic based review Design! Weighted Quick Union with Path Compression Used to represent connectivity between items Each item belongs to its own set, “union” the items together by connecting the sets together Sets will have a tree like structure Optimizations: Union by weight: connect the root of the “lighter” set to the root of the “heavier” set (determined by number of nodes in the set) Path compression: when you “find” a node, compress the node and the path to the node by connecting it to the root of the set 61BL Lab about Disjoint Sets HashMaps Use an array to represent your data For each key-value pair, assign each key a “hash code” mod (%) the hash code by the length of the array (this gives you a number between 0 and array.length - 1), use this as the index! N = num elements, M = num buckets, C = some constant If N/M > C, then increase M! N/M is called the load factor If we have multiple elements that go to same place in the array, usually we will keep track of a list Be careful about negative numbers when modding! This is called external chaining What is the runtime of .contains and .insert? Course Overview (Personal experiences) CS61C: Machine Structures C, assembly language Learn about how computers work! Caching, MapReduce, parallelism CS170: Algorithms CS70: Discrete Math/Probability Proofs for things we’ve seen so far Problem set every week Stable marriage, modular arithmetic, graph theory, etc. CS186: Databases Learn SQL and how databases keep track of all your data, Java “Chill”, though exam was tough this time around…, some projects Guest speakers from the industry Learn to analyze runtimes,
Read full document
- Document name
- Weighted Quick Union và HashMaps (Discussion 14) - Christine Zhou
- School / Course
- University of California, Berkeley · Lập trình Java
- Content
- Buổi thảo luận cuối cùng này cung cấp thông báo về bài tập, dự án và kế hoạch tuần cuối. Tài liệu cũng giới thiệu chi tiết về các khóa học Khoa học Máy tính khác nhau và các khái niệm kỹ thuật như Weighted Quick Union và HashMaps.
- Table of contents
- Agenda
- Announcements
- Design!
- Weighted Quick Union with Path Compression
- HashMaps
- Course Overview (Personal experiences)
- Course Overviews (16x)
- Course Overviews (16x) cont.
- Course Overview (17x)
- Course Overview (18x)
- Course Overview (other)
- Pages
- 18 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!