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
Giới thiệu
Đăng ký
Đăng nhập
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
Giới thiệu
Đăng ký
Đăng nhập
0
Trang chủ
Công Nghệ Thông Tin
Kỹ thuật lập trình
Lecture An Introduction to Object-Oriented Programming with Java (4/e): Chapter 11 - C. Thomas Wu
Đang chuẩn bị liên kết để tải về tài liệu:
Lecture An Introduction to Object-Oriented Programming with Java (4/e): Chapter 11 - C. Thomas Wu
Gia Cần
71
58
ppt
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Chapter 11 - Sorting and searching. After you have read and studied this chapter, you should be able to: Perform linear and binary search algorithms on small arrays, determine whether a linear or binary search is more effective for a given situation, perform selection and bubble sort algorithms, describe the heapsort algorithm and show how its performance is superior to the other two algorithms, apply basic sorting algorithms to sort an array of objects. | Chapter 11 Sorting and Searching 4th Ed Chapter 11 - ©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 10 Objectives After you have read and studied this chapter, you should be able to Perform linear and binary search algorithms on small arrays. Determine whether a linear or binary search is more effective for a given situation. Perform selection and bubble sort algorithms. Describe the heapsort algorithm and show how its performance is superior to the other two algorithms. Apply basic sorting algorithms to sort an array of objects. 4th Ed Chapter 11 - ©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Searching When we maintain a collection of data, one of the operations we need is a search routine to locate desired data quickly. Here’s the problem statement: Given a value X, return the index of X in the array, if such X exists. Otherwise, return NOT_FOUND (-1). We assume there are no duplicate entries in the array. We will count the number of comparisons the algorithms make to analyze their performance. The ideal searching algorithm will make the least possible number of comparisons to locate the desired data. Two separate performance analyses are normally done, one for successful search and another for unsuccessful search. 4th Ed Chapter 11 - ©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Search Result number 23 17 5 90 12 44 38 0 1 2 3 4 5 6 7 8 84 77 Unsuccessful Search: Successful Search: NOT_FOUND search( 45 ) search( 12 ) 4 4th Ed Chapter 11 - ©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Linear Search Search the array from the first to the last position in linear progression. public int linearSearch ( int[] number, int searchValue ) { int loc = 0; while (loc 4th Ed Chapter 11 - ©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 10 Objectives After you have read and studied this chapter, you should be able to Perform linear and binary search algorithms on small arrays. Determine whether a linear or binary search is more effective for a given situation. Perform selection and bubble sort algorithms. Describe the heapsort algorithm and show how its performance is superior to the other two algorithms. Apply basic sorting algorithms to sort an array of objects. 4th Ed Chapter 11 - ©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Searching When we maintain a collection of data, one of the operations we need is a search routine to locate desired data quickly. Here’s the problem statement: Given a value X, return the index of X in the array, if such X exists. Otherwise, return NOT_FOUND (-1). We assume there are no duplicate entries in
TÀI LIỆU LIÊN QUAN
Lecture Introduction to computing - Lesson 28: Introduction to the Internet
Lecture Introduction to XML: XM30 introduction to XML and related technologies
Lecture Introduction to XML: Introduction to Databases and XM
Lecture Introduction to computing - Lesson 1: Introduction
Lecture Introduction to Programming: Lesson 25
Lecture Introduction to Control Systems - Chapter 1: Introduction (Dr. Huynh Thai Hoang)
Lecture Introduction to multimedia - Trần Thị Kim Chi
Lecture Introduction to Networks - Chapter 1: Exploring the Network
Lecture Introduction to Networks - Chapter 2: Configuring a Network Operating System
Lecture Introduction to Networks - Chapter 3: Network Protocols and Communications
crossorigin="anonymous">
Đã 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.