tailieunhanh - Lecture Algorithms and data structures (CSC112) - Chapter 2

Lecture Algorithms and data structures(CSC112): Chapter 2 - Searching. This topic reviews the basic mathematics required in this course: A justification for a mathematical framework, the ceiling and floor functions, L’Hôpital’s rule, logarithms, arithmetic and other polynomial series, geometric series, recurrence relations, weighted averages, combinations. | Review 1 Arrays & Strings Array Array Elements Accessing array elements Declaring an array Initializing an array Two-dimensional Array Array of Structure String Array of Strings Examples Searching Introduction to Searching External and Internal Searching Types of Searching Linear or sequential search Binary Search Algorithms for Linear Search Algorithms for Binary Search 2 Introduction Information retrieval is one of the most important applications of computers We are given a name and are asked for an associated telephone listing We are given an account number and are asked for the transactions occurring in that account We are given an employee name or number and are asked for the employee records 3 Introduction Information retrieval is one of the most important applications of computers We are given a name and are asked for an associated telephone listing We are given an account number and are asked for the transactions occurring in that account We are given an employee name or number and are asked for the employee records 4 Searching is a process of checking and finding an element from a list of elements If we want to find the presence of an element “data” in A, then we have to search for it The search is successful if data does appear in A and unsuccessful otherwise A question you should always ask when selecting a search algorithm is “How fast does the search have to be?” The reason is that, in general, the faster the algorithm is, the more complex it is. Bottom line: you don’t always need to use or should use the fastest algorithm 5 Key In these examples, we are given one piece of information, which we shall call a key We are asked to find a record that contains other information associated with the key We shall allow both the possibility that there is more than one record with the same key and that there is no record with the given key 6 Records and their keys 7 Analysis Searching for the keys that locate records is often the most time-consuming action in a . | Review 1 Arrays & Strings Array Array Elements Accessing array elements Declaring an array Initializing an array Two-dimensional Array Array of Structure String Array of Strings Examples Searching Introduction to Searching External and Internal Searching Types of Searching Linear or sequential search Binary Search Algorithms for Linear Search Algorithms for Binary Search 2 Introduction Information retrieval is one of the most important applications of computers We are given a name and are asked for an associated telephone listing We are given an account number and are asked for the transactions occurring in that account We are given an employee name or number and are asked for the employee records 3 Introduction Information retrieval is one of the most important applications of computers We are given a name and are asked for an associated telephone listing We are given an account number and are asked for the transactions occurring in that account We are given an employee name or .

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.