Armed with the tools outlined in Principles of Algorithm Analysis I, we now consider the analysis of sequential search and binary search, two basic algorithms for determining whether or not any of a sequence of objects appears among a set of previously stored objects. 继续阅读“Principles of Algorithm Analysis II”
Elementary Data Structures ~ Linked Lists I
When our primary interest is to go through a collection of items sequentially, one by one, we can organize the items as a linked list: a basic data structure where each item contains the information that we need to get to the next item. 继续阅读“Elementary Data Structures ~ Linked Lists I”
Elementary Data Structures ~ Arrays
Perhaps the most fundamental data structure is the array, which is defined as a primitive in C and in most other programming languages. We have already seen the use of an array as the basis for the development of an efficient algorithm, in the previous articles; we shall see many more examples in this section. 继续阅读“Elementary Data Structures ~ Arrays”
Elementary Data Structures ~ Building Blocks
Organizing the data for processing is an essential step in the development of a computer program. For many applications, the choice of the proper data structure is the only major decision involved in the implementation: once the choice has been made, the necessary algorithms are simple.
A data structure is not a passive object: We also must consider the operations to be performed on it (and the algorithms used for these operations). This concept is formalized in the notion of a data type. 继续阅读“Elementary Data Structures ~ Building Blocks”
Principles of Algorithm Analysis I
Analysis plays a role at every point in the process of designing and implementing algorithms. At first, as we saw, we can save factors of thousands or millions in the running time with appropriate algorithm design choices. As we consider more efficient algorithms, we find it more of a challenge to choose among them, so we need to study their properties in more detail. In pursuit of the best ( in some precise technical sense ) algorithm, we find both algorithms that are useful in practice and theoretical questions that are challenging to resolve. 继续阅读“Principles of Algorithm Analysis I”
算法:C语言实现~连通性问题
最近正在研读Robert Sedgewick彻底修改和重写的C算法系列的第一本《算法:C语言实现(第1 – 4部分)基础知识、数据结构、排序及搜索》。该书细腻地讲解了计算机算法的C语言实现。徐徐研读,细细品味,偶有记录遂分享之!!! 继续阅读“算法:C语言实现~连通性问题”