Introduction to Algorithm - Summary of Chapter 2(0) - Getting started
来源:互联网 发布:单片机 型号 - 百度 编辑:程序博客网 时间:2024/05/17 01:49
in place: it rearranges the numbers within the array A, with at most a constant number of them stored outside the array at any time.
three things about a loop invariant:
- Initialization: It is true prior to the first iteration of the loop.
- Maintenance: If it is true before an iteration of the loop, it remains true before the next iteration.
- Termination: When the loop terminates, the invariant gives us a useful property that helps show that the algorithm is correct.
Analyzing an algorithm: has come to mean predicting the resources that the algorithm requires.
input size: the number of items in the input.
running time : the number of primitive operations.
incremental approach: Keep a part result satisfying the problem requirement from beginning to end , and expanding it gradually to solve the problem.
recursive: to solve a given problem, they call themselves recursively one or more times to deal with closely related subproblems.
divide-and-conquer approach: they break the problem into several subproblems that are similar to the original problem but smaller in size, solve the subproblems recursively, and then combine these solutions to create a solution to the original problem.
The divide-and-conquer paradigm involves three steps at each level of the recursion:
- Divide the problem into a number of subproblems that are smaller instances of the same problem.
- Conquer the subproblems by solving them recursively. If the subproblem sizes are small enough, however, just solve the subproblems in a straightforward manner.
- Combine the solutions to the subproblems into the solution for the original problem.
Recurrence equation : describes the overall running time on a problem of size n in terms of the running time on smaller problem.
In the equation ,
Some of above content refere to “Introduction to Algorithm”.
- Introduction to Algorithm - Summary of Chapter 2(0) - Getting started
- Introduction to Algorithm - Summary of Chapter 2(2) - Merge Sort
- Introduction to Algorithm - Summary of Chapter 2(1) - Insertion sort
- Growth of Functions - Introduction to Algorithm - Summary of Chapter 3
- Introduction to Algorithm - Summary of Chapter 7 - Quicksort
- Introduction to Algorithm - Summary of Chapter 6 - Heapsort
- Introduction to Algorithm - Summary of Chapter 1 - The Role of Algorithm in Computing
- Introduction to Algorithm - Summary of Chapter 8 - Sorting in Linear Time
- Medians and Order Statistics - Introduction to Algorithm - Summary of Chapter 9
- Chapter 0: Getting started
- Chapter 2 Getting Started
- Introduction to Algorithm(chapter 5)
- Introduction to Algorithm(chapter 6)
- Introduction to Algorithm(chapter 7)
- Introduction to Algorithm(chapter 8)
- Introduction to Algorithm(chapter 11)
- Introduction to Algorithm(chapter 12)
- Introduction to algorithm(chapter 13)
- 男儿当自强
- 改变查看源码编辑器
- const 引用
- 关于printf("%d,%d",num++,++num); 打印结果的探讨
- “破碎”的md5恢复
- Introduction to Algorithm - Summary of Chapter 2(0) - Getting started
- 线程池
- Ted Mosby - 一个MVP框架的软件架构
- NUMA技术相关笔记
- iOS 性能的优化
- NVIC中断优先级管理+串口通信基本原理+串口通信基于库函数的配置实例
- 详解前端模块化工具-Webpack
- Git 分支 - 分支的新建与合并
- 语音识别开源项目----CMU Sphinx介绍