Intro to Asymptotics and Bits (Discussion 6) (Ký hiệu tiệm cận và các phép toán bit) - Christine Zhou
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.
Đang tạo bản xem trước...
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
… Tải file gốc để đọc toàn bộ tài liệu.
- Tên tài liệu
- Intro to Asymptotics and Bits (Discussion 6) (Ký hiệu tiệm cận và các phép toán bit) - Christine Zhou
- Trường / Môn
- University of California, Berkeley · Lập trình Java
- Tác giả (trong tài liệu)
- Christine Zhou
- Nội dung
- 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.
- Mục lục
- 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
- 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ó. “Intro to Asymptotics and Bits (Discussion 6) (Ký hiệu tiệm cận và các phép toán bit) - 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!