Intro to Asymptotics and Bits (Discussion 6) (Ký hiệu tiệm cận và các phép toán bit) - Christine Zhou
Generating preview...
Slide thảo luận về ký hiệu tiệm cận (Big O, Big Theta, Big Omega) và các phép toán bit, bao gồm bài tập phân tích thời gian chạy và thao tác bit.
Description
Discussion 6: Intro to Asymptotics And Bits Christine Zhou Agenda Announcements And time to fill out surveys Asymptotics Review Problem 1,2 Bits and Bitwise Operators Problem 3 Announcements Midterm grades have been released! Place to Vent (ANONYMOUS): tinyurl.com/placetovent HW3 due yesterday TLDR: Make sure everything works on the instructional account Start Project 1 if you haven’t already! (PLEASE FILL OUT TODAY) Discussion survey: tinyurl.com/disc6cz Asymptotics: Big Ө(...) Called “big theta notation” R(N) = runtime, f(N) = function, k’s = constants The runtime can be both upper and lower bounded by the function Let’s say R(N) = 3n3 + 2n2 + 1 What is a good f(N), k1, k2? f(N) = n3, k1 = 2, k2 = 4 Asymptotics: Big O(...) Called “big oh notation” R(N) = runtime, f(N) = function, k = constant The function is an upper bound on the runtime DOES NOT MEAN WORST CASE True or false? N2 ∈ O(N2) N2 ∈ O(N500) N log N ∈ O(N) log N ∈ O(N2) Asymptotics: Big Ω(...) Called “big omega notation” R(N) = runtime, f(N) = function, k = constant The function is a lower bound on the runtime DOES NOT MEAN BEST CASE True or false? N2 ∈ Ω(N2) N ∈ Ω(1) N2 ∈ Ω(N3) 1 Basic Algorithmic Analysis Solutions: 1. f ∈ 𝛳(g) 2. f ∈ O(g) 3. f ∈ O(g) 4. f ∈ Ω(g) 5. f ∈ 𝛳(g) 2 Practice with Runtime 2 Practice with Runtime Bits Each number has a bit representation 01110 = 0*24 + 1*23 + 1*22 + 1*21 + 0*20 = 14 Bitwise Operators OR (|) 0 __ 0 0 0 0 __ 1 0 1 1 __ 1 1 1 x << y: shift the bit representation of x by y to the left (rest are filled with 0’s) AND (&) If x is 10011 and y is 2 x << y is 01100 x >> y: shift the bit representation of x by y to the right (rest are filled with 0’s) If x is 10011 and y is 2 3 A Bit with some Bits Let’s figure out what this question is asking first... Complete the following method such that it does what it is intended to do: given a list of integers, it returns an i
AI summary
- Document name
- Intro to Asymptotics and Bits (Discussion 6) (Ký hiệu tiệm cận và các phép toán bit) - Christine Zhou
- School / Course
- University of California, Berkeley · Lập trình Java
- Author (in document)
- Christine Zhou
- Content
- Tài liệu này cung cấp kiến thức nền tảng về giới hạn tiệm cận (Big Theta, Big O, Big Omega) và các toán tử bitwise. Nó bao gồm các ví dụ thực hành và một bài tập để áp dụng các khái niệm đã học.
- Table of contents
- Agenda
- Announcements
- Asymptotics Review
- Problem 1,2
- Bits and Bitwise Operators
- Problem 3
- Asymptotics: Big Θ(...)
- Asymptotics: Big O(...)
- Asymptotics: Big Ω(...)
- 1 Basic Algorithmic Analysis
- 2 Practice with Runtime
- Bits
- Bitwise Operators
- 3 A Bit with some Bits
- Pages
- 12 pages
- Uploaded by
- Uni24h
Frequently asked questions
Is this document free?
Yes. “Intro to Asymptotics and Bits (Discussion 6) (Ký hiệu tiệm cận và các phép toán bit) - 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.
Intro to Asymptotics and Bits (Discussion 6) (Ký hiệu tiệm cận và các phép toán bit) - Christine Zhou
Generating preview...
Discussion 6: Intro to Asymptotics And Bits Christine Zhou Agenda Announcements And time to fill out surveys Asymptotics Review Problem 1,2 Bits and Bitwise Operators Problem 3 Announcements Midterm grades have been released! Place to Vent (ANONYMOUS): tinyurl.com/placetovent HW3 due yesterday TLDR: Make sure everything works on the instructional account Start Project 1 if you haven’t already! (PLEASE FILL OUT TODAY) Discussion survey: tinyurl.com/disc6cz Asymptotics: Big Ө(...) Called “big theta notation” R(N) = runtime, f(N) = function, k’s = constants The runtime can be both upper and lower bounded by the function Let’s say R(N) = 3n3 + 2n2 + 1 What is a good f(N), k1, k2? f(N) = n3, k1 = 2, k2 = 4 Asymptotics: Big O(...) Called “big oh notation” R(N) = runtime, f(N) = function, k = constant The function is an upper bound on the runtime DOES NOT MEAN WORST CASE True or false? N2 ∈ O(N2) N2 ∈ O(N500) N log N ∈ O(N) log N ∈ O(N2) Asymptotics: Big Ω(...) Called “big omega notation” R(N) = runtime, f(N) = function, k = constant The function is a lower bound on the runtime DOES NOT MEAN BEST CASE True or false? N2 ∈ Ω(N2) N ∈ Ω(1) N2 ∈ Ω(N3) 1 Basic Algorithmic Analysis Solutions: 1. f ∈ 𝛳(g) 2. f ∈ O(g) 3. f ∈ O(g) 4. f ∈ Ω(g) 5. f ∈ 𝛳(g) 2 Practice with Runtime 2 Practice with Runtime Bits Each number has a bit representation 01110 = 0*24 + 1*23 + 1*22 + 1*21 + 0*20 = 14 Bitwise Operators OR (|) 0 __ 0 0 0 0 __ 1 0 1 1 __ 1 1 1 x << y: shift the bit representation of x by y to the left (rest are filled with 0’s) AND (&) If x is 10011 and y is 2 x << y is 01100 x >> y: shift the bit representation of x by y to the right (rest are filled with 0’s) If x is 10011 and y is 2 3 A Bit with some Bits Let’s figure out what this question is asking first... Complete the following method such that it does what it is intended to do: given a list of integers, it returns an i
Read full document
- Document name
- Intro to Asymptotics and Bits (Discussion 6) (Ký hiệu tiệm cận và các phép toán bit) - Christine Zhou
- School / Course
- University of California, Berkeley · Lập trình Java
- Author (in document)
- Christine Zhou
- Content
- Tài liệu này cung cấp kiến thức nền tảng về giới hạn tiệm cận (Big Theta, Big O, Big Omega) và các toán tử bitwise. Nó bao gồm các ví dụ thực hành và một bài tập để áp dụng các khái niệm đã học.
- Table of contents
- Agenda
- Announcements
- Asymptotics Review
- Problem 1,2
- Bits and Bitwise Operators
- Problem 3
- Asymptotics: Big Θ(...)
- Asymptotics: Big O(...)
- Asymptotics: Big Ω(...)
- 1 Basic Algorithmic Analysis
- 2 Practice with Runtime
- Bits
- Bitwise Operators
- 3 A Bit with some Bits
- 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!