Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Sức khỏe - Y tế
Văn bản luật
Nông Lâm Ngư
Kỹ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Tài liệu HOT
Tìm
Danh mục
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Y tế sức khỏe
Văn bản luật
Nông lâm ngư
Kĩ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Thông tin
Điều khoản sử dụng
Quy định bảo mật
Quy chế hoạt động
Chính sách bản quyền
0
Trang chủ
Công Nghệ Thông Tin
Cơ sở dữ liệu
DATA STRUCTURES OR ALGORITHMS
TAILIEUCHUNG - DATA STRUCTURES OR ALGORITHMS
Question 1. Reorder the following efficiencies from the smallest to the largest: a. 2n3 + n5 b. 2000 c. 4n+1 d. n4 e. (n-1)! f. nlog2(n) g. 2klogk(n) (k is a predefined constant) Solution: Efficiency: a measure of amount of time for an algorithm to execute (Time Efficiency) or a measure of amount of memory needed for an algorithm to execute (Space Efficiency). | Faculty of Computer Science and Engineering Department of Computer Science DATA STRUCTURES ALGORITHMS Tutorial 1 Questions COMPUTATIONAL COMPLEXITY Required Questions Question 1. Reorder the following efficiencies from the smallest to the largest a. 2n3 n5 b. 2000 c. 4n 1 d. n4 e. n-1 f nlog2 n g. 2klogk n k is a predefined constant Solution Efficiency a measure of amount of time for an algorithm to execute Time Efficiency or a measure of amount of memory neededfor an algorithm to execute Space Efficiency . Non-decreasing order 2000 2k logk n n log2 n n4 2n3 n5 4n 1 n-1 Question 2. Determine the big-O notation for the following a. 2n6 b. 100n 3 7 c. 9log2 n d. 5n10 2logn e. n k k is a predefined constant f 100log2 n 5 n 2n Solution a. O n6 b. O n c. O log2 n d. O n10 e. O n f. O n Question 3. Calculate the run-time efficiency of the following program segment 1 i n-1 2 loop i n 2 1 j 1 2 loop j n 2 1 print i j 2 jj j 2 3 end loop 4 i i - 2 3 end loop Solution Note n 2 n 2 rounded down If n 2 is odd the run-time efficiency is n 4 n2 2 O n2 Released on 03 09 2012 10 09 56 1 5 Faculty of Computer Science and Engineering Department of Computer Science If n 2 is even the run-time efficiency is n 4. n 4-1 O n2 Or generally the run-time efficiency of the given program segment is O n2 . Question 4. Calculate the run-time efficiency of the following program segment 1 i n3 2 loop i n 2 1 j 1 2 loop j n 2 1 print i j 2 jj j 2 3 end loop 4 i i 2 3 end loop Solution There are 2 nested loops the iteration of variable i is executed 2log2 n n3 2x n 2 x log2n2 2log2n times j is executed n 4 or n 4 -1 times Therefore the run-time efficiency is 2 log2 n n 4 O nlog2 n . Question 5. If the algorithm dolt has an efficiency factor of 2n calculate the run time efficiency of the following program segment 1 i 1 2 loop i n 1 j 1 2 loop j n 1 k 1 2 loop k n 1 dolt . 2 k k 2 3 end loop 4 j j 1 3 end loop 4 i i 1 3 end loop Solution There are 3 nested loops the iteration of .
Cẩm Yến
100
32
pdf
Báo lỗi
Trùng lắp nội dung
Văn hóa đồi trụy
Phản động
Bản quyền
File lỗi
Khác
Upload
Tải xuống
đang nạp các trang xem trước
Không thể tạo bản xem trước, hãy bấm tải xuống
Tải xuống
TÀI LIỆU LIÊN QUAN
Ebook Data structures and algorithms made easy: Data structures and algorithmic puzzles
828
117
0
Data Structures and File ProcessingC++
1
113
0
Lecture Data Structures: Lesson 1
50
27
1
Data Structures & Problem Solving Using Java
1
107
1
Data Structures and Algorithms DSA
112
124
0
Data Structures Fundamentals
67
101
0
Lecture Data structures and algorithms: Chapter 1 - Introduction
41
1
1
Lecture ECE 250 - Algorithms and data structures: Data structures and algorithms
35
99
1
Lecture Data structures and algorithms in Java (6th edition): Chapter 8 - Goodrich, Tamassia, Goldwasser
10
133
0
Lecture Data structures and algorithms in Java (6th edition): Chapter 9.1 - Goodrich, Tamassia, Goldwasser
7
125
0
TÀI LIỆU XEM NHIỀU
Một Case Về Hematology (1)
8
461867
55
Giới thiệu :Lập trình mã nguồn mở
14
22642
59
Tiểu luận: Tư tưởng Hồ Chí Minh về xây dựng nhà nước trong sạch vững mạnh
13
10892
529
Câu hỏi và đáp án bài tập tình huống Quản trị học
14
10066
446
Phân tích và làm rõ ý kiến sau: “Bài thơ Tự tình II vừa nói lên bi kịch duyên phận vừa cho thấy khát vọng sống, khát vọng hạnh phúc của Hồ Xuân Hương”
3
9519
104
Ebook Facts and Figures – Basic reading practice: Phần 1 – Đặng Tuấn Anh (Dịch)
249
8281
1125
Tiểu luận: Nội dung tư tưởng Hồ Chí Minh về đạo đức
16
8238
423
Mẫu đơn thông tin ứng viên ngân hàng VIB
8
7864
2220
Đề tài: Dự án kinh doanh thời trang quần áo nữ
17
6686
253
Vật lý hạt cơ bản (1)
29
5770
85
TỪ KHÓA LIÊN QUAN
Cơ sở dữ liệu
Data Structures
Algorithms
Ruby Programming Language
Abstract Data Types
Container Taxonomy
The Stack ADT
Ebook Data structures and algorithms made easy
Data structures and algorithms made easy
Data structures and algorithmic puzzles
Data structures for storing strings
Algorithms design techniques
data structure lectures
structured document data
teaching data structures
algorithms in data structures
Lecture Data Structures
Bài giảng Cấu trúc dữ liệu
Programming assignments
Data structures organize data
Resource constraints
Lecture Data structures and algorithms
Data structures and algorithms
Cấu trúc dữ liệu và giải thuật
Abstract data type
Lecture ECE 250
Lecture Algorithms and data structures
Algorithm analysis
Graph algorithms
Memory allocation
Computer science
Design of data structures
Algorithms in Java
AVL trees
Binary search trees
Red black trees
Splay trees
Dynamic programming
TÀI LIỆU MỚI ĐĂNG
Đánh giá hao mòn và độ tin cậy của chi tiết và kết cấu trên đầu máy diezel part 3
12
305
0
27-04-2024
Oreilly learning the vi Editor phần 4
19
228
0
27-04-2024
Trading Strategies Profit Making Techniques For Stock_8
23
175
0
27-04-2024
Anh văn bằng C-124
8
175
0
27-04-2024
TƯƠNG QUAN GIỮA MÔ HỌC, GIẢI PHẪU VÀ HÌNH ẢNH CỦA CÁC KHỐI U PHẦN PHỤ
3
167
0
27-04-2024
BÀI GIẢNG VỀ - MẠCH ĐIỆN II - Chương I: Phân tích mạch trong miền thời gian
38
140
0
27-04-2024
MÔN HỌC VẬT LIỆU VÀ CÔNG NGHỆ KIM LOẠI - PHẦN I: KIM LOẠI HỌC
32
176
2
27-04-2024
QUẢN LÝ CHẤT LƯỢNG KHÔNG KHÍ
75
137
0
27-04-2024
Báo cáo tốt nghiệp: Vận hành và bảo dưỡng trong MPLS
92
144
3
27-04-2024
Hệ thống làm lạnh và điều hòa không khí
21
125
0
27-04-2024
TÀI LIỆU HOT
Mẫu đơn thông tin ứng viên ngân hàng VIB
8
7864
2220
Giáo trình Tư tưởng Hồ Chí Minh - Mạch Quang Thắng (Dành cho bậc ĐH - Không chuyên ngành Lý luận chính trị)
152
5735
1368
Ebook Chào con ba mẹ đã sẵn sàng
112
3767
1231
Ebook Tuyển tập đề bài và bài văn nghị luận xã hội: Phần 1
62
5319
1136
Ebook Facts and Figures – Basic reading practice: Phần 1 – Đặng Tuấn Anh (Dịch)
249
8281
1125
Giáo trình Văn hóa kinh doanh - PGS.TS. Dương Thị Liễu
561
3499
643
Tiểu luận: Tư tưởng Hồ Chí Minh về xây dựng nhà nước trong sạch vững mạnh
13
10892
529
Giáo trình Sinh lí học trẻ em: Phần 1 - TS Lê Thanh Vân
122
3684
525
Giáo trình Pháp luật đại cương: Phần 1 - NXB ĐH Sư Phạm
274
4046
515
Bài tập nhóm quản lý dự án: Dự án xây dựng quán cafe
35
4128
480
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.