Algorithm - Introduction

Goal:

Use Computer to solve problems step by step!!!

What is Computer Science?

Computer Science is the study of problems, problem-solving, and the solutions that come out of the problem-solving process.

What is Programming?

Programming is the process of taking an algorithm and encoding it into a notaion, a programming language, so that it can be executed by a computer.

All data items in the computer are represented as a strings of binary digits. In order to give these strings meaning, we need to have data types.

Why Study Data Structures and Abstract Data Types?

An abstract data type, sometimes abbreviated ADT, is a logical description of how we view the data and the operations that are allowed without regard to how they will be implemented.

Why Study Algorithms?

There are often many ways to solve  a problem. Finding a solution and then deciding whether it is a good one are tasks that we will do over and over again.

时间: 2024-08-06 03:38:55

Algorithm - Introduction的相关文章

2015阿里实习线上笔试题-附加题1

随机数生成器 计算机使用的随机数生成器往往是伪随机的,为了达到统计意义上的真随机数,可以需要引入系统 外的变量等作为随机种子(如UNIX系统中熵池).假设有一天出现了上帝的投硬币函数: int G(); 由于这里用到的上帝硬币可能不均匀.但可以保证是G()可以x概率返回1,1-x的概率返回0,其中x为未知常数(且x不等于0或1). 请实现目标函数: int F(double p); 要求 F函数以概率p返回1,以1-p返回0. 除了G之外,不使用的任何库函数. PS:定义宏UINT_MAX=0x

machine learning学习笔记

看到Max Welling教授主页上有不少学习notes,收藏一下吧,其最近出版了一本书呢还,还没看过. http://www.ics.uci.edu/~welling/classnotes/classnotes.html Statistical Estimation [ps]- bayesian estimation- maximum a posteriori (MAP) estimation- maximum likelihood (ML) estimation- Bias/Variance

Johnson 全源最短路径算法

解决单源最短路径问题(Single Source Shortest Paths Problem)的算法包括: Dijkstra 单源最短路径算法:时间复杂度为 O(E + VlogV),要求权值非负: Bellman-Ford 单源最短路径算法:时间复杂度为 O(VE),适用于带负权值情况: 对于全源最短路径问题(All-Pairs Shortest Paths Problem),可以认为是单源最短路径问题的推广,即分别以每个顶点作为源顶点并求其至其它顶点的最短距离.例如,对每个顶点应用 Bel

Ford-Fulkerson 最大流算法

流网络(Flow Networks)指的是一个有向图 G = (V, E),其中每条边 (u, v) ∈ E 均有一非负容量 c(u, v) ≥ 0.如果 (u, v) ∉ E 则可以规定 c(u, v) = 0.流网络中有两个特殊的顶点:源点 s (source)和汇点 t(sink).为方便起见,假定每个顶点均处于从源点到汇点的某条路径上,就是说,对每个顶点 v ∈ E,存在一条路径 s --> v --> t.因此,图 G 为连通图,且 |E| ≥ |V| - 1. 下图展示了一个流网络

Bellman-Ford 单源最短路径算法

Bellman-Ford 算法是一种用于计算带权有向图中单源最短路径(SSSP:Single-Source Shortest Path)的算法.该算法由 Richard Bellman 和 Lester Ford 分别发表于 1958 年和 1956 年,而实际上 Edward F. Moore 也在 1957 年发布了相同的算法,因此,此算法也常被称为 Bellman-Ford-Moore 算法. Bellman-Ford 算法和 Dijkstra 算法同为解决单源最短路径的算法.对于带权有向

Floyd-Warshall 全源最短路径算法

Floyd-Warshall 算法采用动态规划方案来解决在一个有向图 G = (V, E) 上每对顶点间的最短路径问题,即全源最短路径问题(All-Pairs Shortest Paths Problem),其中图 G 允许存在权值为负的边,但不存在权值为负的回路.Floyd-Warshall 算法的运行时间为 Θ(V3). Floyd-Warshall 算法由 Robert Floyd 于 1962 年提出,但其实质上与 Bernad Roy 于 1959 年和 Stephen Warshal

红外目标图像中阈值分割方法的比较与研究

红外目标图像中阈值分割方法的比较与研究   摘要:本文主要以红外图像目标检测技术为背景,在图像阈值分割中以最大熵准则及遗传算法为基础,研究了一维最大熵值法(KSW法)及基于遗传算法的KSW熵法单阈值.双阈值等三种不同的阈值分割方法,并通过实验仿真验证了它们的性能及差异.实验结果表明:基于遗传算法的KSW熵法的双阈值分割方法,可以用于红外型目标检测系统中,并取得良好效果,为了验证其是否具有普适性,在其它科学领域如:沿海码头等方向也做了相应的仿真实验,结果较为满意. 关键词:红外目标检测:阈值分割:

A Gentle Introduction to the Gradient Boosting Algorithm for Machine Learning

A Gentle Introduction to the Gradient Boosting Algorithm for Machine Learning by Jason Brownlee on September 9, 2016 in XGBoost 0 0 0 0 Gradient boosting is one of the most powerful techniques for building predictive models. In this post you will dis

divide-conquer-combine(4.1 from the introduction to algorithm)

this example is from chapter 4 in <the introduction to algorithm> the main idea is all showed in the book , i think maybe realizing the algorithm is a good way to understand it. /* from : introduction to algorithm chapter four algorithm:divide and c