算法基础 (Coursera)

Offered by Peking University,
算法基础 (Coursera)

本课程内容程涵盖枚举、二分、贪心、递归、深度优先搜索、广度优先搜索、动态规划等基本算法。通过大量的高强度的编程训练,提高动手能力,做到能较为熟练、完整、准确地实现自己设计的程序,为进一步学习其他计算机专业课程,或在其他专业领域运用计算机编程解决问题奠定良好的基础。

Class Deals by MOOC List - Click here and see Coursera's Active Discounts, Deals, and Promo Codes.

本课程内容程涵盖枚举、二分、贪心、递归、深度优先搜索、广度优先搜索、动态规划等基本算法,配以适量的在线评测例题,使得学员通过本课程的学习,不但能够掌握这些算法的原理,还能够对这些算法进行灵活应用以及准确实现。本课程的中的编程任务,将充分训练学员的思维能力和动手能力,促成对学员全面、缜密思考问题的习惯。达到本门课程的要求,即意味者学员具备了初步的算法基础和较强的编程实现能力。
Course 4 of 7 in the 程序设计与算法 Specialization.

Syllabus

WEEK 1
欢迎加入我们!
好的算法是程序设计的灵魂!拥有了骄人战绩的你,在熟练掌握程序设计语言的同时,只有掌握了算法这个利器之后,才能在驾驭程序开发项目中出其不意、鬼斧神工!欢迎加入《算法基础》课程,为你的程序插上飞翔的翅膀!PS:我们这门课程一直处在不断地建设与优化当中,吸取了很多以往课程的经典视频,所以如果你看到视频中出现了不同课程的名字,也不要惊讶哦,因为你正在集百家所长:)

WEEK 2
枚举
在日常生活中我们经常遇到这样的情景:数字密码最后一位忘记了,就从0~9逐个尝试;去提货点取快递,快递员检查完所有包裹才找到属于你的;警察列举出所有的嫌疑人才有可能发现真凶…以上在进行归纳推理时,逐个考察了某类事情的所有可能情况,并逐一进行检验,这种方法叫做枚举。枚举比较直观,易于理解,本模块将介绍枚举算法的基本数学模型和常用策略,从而解决通过公式推导、规则演绎的方法不能解决的问题。PS:我们这门课程一直处在不断地建设与优化当中,吸取了很多以往课程的经典视频,所以如果你看到视频中出现了不同课程的名字,也不要惊讶哦,因为你正在集百家所长:)

WEEK 3
递归
递归调用是设计和描述算法的一种有力工具,尤其是在解决复杂问题时经常采用。它的基本思想是要解决某一问题A,可以先解决一个形式相同,但规模小一点的问题B。问题B如果解决了,那么问题A也就迎刃而解。有些问题使用传统的迭代算法是很难求解甚至无解的,而使用递归却可以很容易地解决。本模块将通过具体的例题介绍如何构造递归函数,如何设置递归终止的条件以及分析递归算法的复杂度。

WEEK 4
动态规划(1)
通过上一模块的学习,你已经了解如何通过递归的办法解决问题,但是单纯的递归往往会导致子问题被重复计算,因此在解决某些问题的时候,效率会很低。而将一个问题分解为子问题递归求解,并且将中间结果保存以避免重复计算的方法就叫做“动态规划”。本模块将初步介绍对于特定的问题如何寻找子问题、定义问题的状态以及状态转移方程。

WEEK 5
动态规划(2)
如何进行动态规划,没有一定之规,需要具体问题具体分析。本模块首先由典型的“最长上升子序列”引入,进一步展示几个较难的动规例题,深入探讨动态规划算法中状态的设计以及状态转移关系的构建。

WEEK 6
深度优先搜索(1)
想象我们在一座迷宫里,如何才能找到出口呢?最直观的方法是从入口开始沿着一条路一直走到底,如果遇到分叉路口就选择其中一条道路走下去,如果遇到死胡同就退回到上一个分叉路口,选择另一条道路走下去,如果遇到出口就成功走出迷宫了。这种尽量往深处走的做法即是深度优先搜索(深搜)。深搜算法编程简单,简洁易懂,空间需求也比较低,但是这种方法的时间复杂度往往是指数级的,如果不加以优化,时间效率无法忍受。本模块将通过实例继续讨论深度优先搜索算法中优化程序的基本方法“剪枝”,即在设计剪枝判断方法的基础上,避免一些不必要的遍历过程,从而提高算法效率。

WEEK 7
深度优先搜索(2)
本模块继续通过两道例题,强调了两种最通用的剪枝方法:可行性剪枝和最优性剪枝的应用。可行性剪枝即在寻找解的过程中,预判出从当前状态出发不可能找到解,从而不再从当前状态继续;最优性剪枝就是记录到目前为止找到的最优解,当发现正在探索的解其代价已经不小于最优解,或预测出其最终代价必将不小于最优解,则停止当前解的探索。

WEEK 8
广度优先搜索
与深度优先搜索算法类似,广度优先搜索(广搜)也是常用的搜索图的算法。它的思想是从一个顶点开始,辐射状地优先遍历其周围较广的区域。一般可以用它做什么呢?一个最直观经典的例子就是走迷宫,从起点开始,找出到终点的最短路程,很多最短路径算法都是基于广搜的思想。广索的基本方法是使用队列存放已经扩展过的节点。本模块先以简单例题引入广搜的基本实现方法,然后再通过经典的"八数码"问题,进一步介绍状态表示、判重的节省时间和空间的技巧。

WEEK 9
二分与贪心
二分法是在有序或单调的区间中快速寻找答案的有效方法,当数据量很大适宜采用该方法。所谓贪心算法,即总是作出在当前看来最好的选择。也就是说贪心算法并不从整体最优考虑,它所作出的选择只是在某种意义上的局部最优选择。但是,贪心算法对很多问题都能得到整体最优解。在一些情况下,即使贪心算法不能得到整体最优解,其最终结果却是最优解的很好近似。贪心算法没有固定的算法框架,算法设计的关键是贪心策略的选择。本模块将介绍二分与贪心这两个对很多问题都非常有效的算法策略。

WEEK 10
期末考试
3个小时11道题目,这就是每年我们程序设计实习课程在校内的收官之作,让无数北大学生魂牵梦绕又各种怨念纠结的期末盛宴。你是不是准备好了呢?快来测测吧!也别忘了,搞定了基本算法并不代表着你作为程序员所向披靡啦,毕竟好的 程序=数据结构+算法。快去参加张铭老师的《数据结构基础》吧,你值得拥有!

WEEK 11
结束语
真的要把课程的接力棒传给张老师了,颇有些不舍!很高兴通过MOOC专项课程的方式结识不一样的你。希望我们的课程能带给你收获与思考,加油,你会是一位出色的程序员!

Go to Class
MOOC List is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Related Courses

Applied Text Mining in Python (Coursera) Coursera
University of Michigan

Applied Text Mining in Python (Coursera)

This course will introduce the learner to text mining and text manipulation basics. The course begins with an understanding of how text is handled by python, the structure of text both to the machine and to humans, and an overview of the nltk framework for manipulating text. The second week focuses on common manipulation needs, including regular expressions (searching for text), cleaning text, and preparing text for use by machine learning processes. The third week will apply basic natural language processing methods to text, and demonstrate how text classification is accomplished. The final week will explore more advanced methods for detecting the topics in documents and grouping them by similarity (topic modelling).

Oct 12th 2026
4 Weeks
Creative Programming for Digital Media & Mobile Apps (Coursera) Coursera
University of London,Goldsmiths, University of London

Creative Programming for Digital Media & Mobile Apps (Coursera)

This course is for anyone who would like to apply their technical skills to creative work ranging from video games to art installations to interactive music, and also for artists who would like to use programming in their artistic practice. This course will teach you how to develop and apply programming skills to creative work. This is an important skill within the development of creative mobile applications, digital music and video games. It will teach the technical skills needed to write software that make use of images, audio and graphics, and will concentrate on the application of these skills to creative projects. Additional resources will be provided for students with no programming background.

Oct 12th 2026
5-12 Weeks
Persistent Memory Technology - Introduction and Deployment (Coursera) Coursera
EDUCBA

Persistent Memory Technology - Introduction and Deployment (Coursera)

Embark on a dynamic learning journey through this course. In the first module, explore the intricacies of Persistent Memory (PMEM), unraveling its fundamental concepts, characteristics, and operating system support. Transition seamlessly into the second module, mastering transactional concepts, optimizing hardware configurations, and discerning between volatile and persistent libraries. In the final module, dive into advanced programming with libpmemobj, overcoming C++ Standard limitations, and applying insights to real-world scenarios like building a phonebook.

Oct 12th 2026
3 Weeks
Analytic Combinatorics (Coursera) Coursera
Princeton University

Analytic Combinatorics (Coursera)

Analytic Combinatorics teaches a calculus that enables precise quantitative predictions of large combinatorial structures. This course introduces the symbolic method to derive functional relations among ordinary, exponential, and multivariate generating functions, and methods in complex analysis for deriving accurate asymptotics from the GF equations. All the features of this course are available for free. It does not offer a certificate upon completion.

Oct 5th 2026
5-12 Weeks
Problem Solving Using Computational Thinking (Coursera) Coursera
University of Michigan

Problem Solving Using Computational Thinking (Coursera)

Have you ever heard that computers "think"? Believe it or not, computers really do not think. Instead, they do exactly what we tell them to do. Programming is, "telling the computer what to do and how to do it." Before you can think about programming a computer, you need to work out exactly what it is you want to tell the computer to do. Thinking through problems this way is Computational Thinking. Computational Thinking allows us to take complex problems, understand what the problem is, and develop solutions. We can present these solutions in a way that both computers and people can understand.

Oct 12th 2026
5-12 Weeks
Introduction to Software, Programming, and Databases (Coursera) Coursera
IBM

Introduction to Software, Programming, and Databases (Coursera)

There are many types of software and understanding software can be overwhelming. This course aims to help you understand more about the types of software and how to manage software from an information technology (IT) perspective. This course will help you understand the basics of software, cloud computing, web browsers, development and concepts of software, programming languages, and database basics.

Oct 12th 2026
5-12 Weeks
Algorithms, Part II (Coursera) Coursera
Princeton University

Algorithms, Part II (Coursera)

This course covers the essential information that every serious programmer needs to know about algorithms and data structures, with emphasis on applications and scientific performance analysis of Java implementations. Part I covers elementary data structures, sorting, and searching algorithms. Part II focuses on graph- and string-processing algorithms.

Oct 12th 2026
5-12 Weeks
Build a Modern Computer from First Principles: Nand to Tetris Part II (project-centered course) (Coursera) Coursera
Hebrew University of Jerusalem

Build a Modern Computer from First Principles: Nand to Tetris Part II (project-centered course) (Coursera)

In this project-centered course you will build a modern software hierarchy, designed to enable the translation and execution of object-based, high-level languages on a bare-bone computer hardware platform. In particular, you will implement a virtual machine and a compiler for a simple, Java-like programming language, and you will develop a basic operating system that closes gaps between the high-level language and the underlying hardware platform.

Oct 12th 2026
5-12 Weeks