QUESTION :

What are the 10 algorithms one must know in order to solve most algorithm challenges/puzzles?

ANSWER:

Dynamic Programming (DP) appears to account for a plurality (some estimate up to a third) of contest problems. Of course, DP is also not a single algorithm that you can just learn once and retain, so maybe this doesn't answer your question.

I suppose it also depends on whether you consider data structures in the same category as algorithms. There are certainly some data structures that you should be familiar with if you want to do well in programming competitions. The most important ones are range trees (variously known as interval trees or segment trees) and binary indexed trees (BITs), also known as Fenwick trees. Additionally, many DP algorithms make use of a prefix sum array.

The most essential of the single algorithms I can think of are the following, in no particular order. However, you may be disappointed by how rarely some of these actually appear in contests. Most non-DP problems appear to be of the "ad hoc with data structures" variety, and you simply have to practice in order to get good at them.

(To be clear, again, I list below only algorithms that take a single input set, compute some function of it, and carry no state between inputs. This distinguishes them from data structures, which by definition hold state, and categories of algorithms and algorithmic techniques like DP, which don't have some specific function they compute.)

    • Sieve of Eratosthenes, or another prime number sieve
    • Depth-first search
    • Breadth-first search
    • Dijkstra's algorithm
    • Floyd--Warshall algorithm
    • Either Kruskal's or Prim's algorithm
    • Some implementation of topological sorting, such as by using DFS
    • Convex hull (I recommend the Monotone Chains algorithm)
    • Coordinate compression
    • Edmonds--Karp, or another implementation of the Ford--Fulkerson method; or a preflow-push algorithm; or, if you are preparing an ACM codebook, Dinic's algorithm. (Note: Max flow is not allowed to appear on the IOI, but may nevertheless appear on national team-selection contests)

-- By Brian Bi

Excerpt from :https://www.quora.com/What-are-the-10-algorithms-one-must-know-in-order-to-solve-most-algorithm-challenges-puzzles

What are the 10 algorithms one must know in order to solve most algorithm challenges/puzzles?的更多相关文章

  1. Top 10 Algorithms for Coding Interview--reference

    By X Wang Update History:Web Version latest update: 4/6/2014PDF Version latest update: 1/16/2014 The ...

  2. 转:Top 10 Algorithms for Coding Interview

    The following are top 10 algorithms related concepts in coding interview. I will try to illustrate t ...

  3. Top 10 Algorithms of 20th and 21st Century

    Top 10 Algorithms of 20th and 21st Century MATH 595 (Section TTA) Fall 2014 TR 2:00 pm - 3:20 pm, Ro ...

  4. 18 Candidates for the Top 10 Algorithms in Data Mining

    Classification============== #1. C4.5 Quinlan, J. R. 1993. C4.5: Programs for Machine Learning.Morga ...

  5. [zt]Which are the 10 algorithms every computer science student must implement at least once in life?

    More important than algorithms(just problems #$!%), the techniques/concepts residing at the base of ...

  6. 机器学习算法之旅A Tour of Machine Learning Algorithms

    In this post we take a tour of the most popular machine learning algorithms. It is useful to tour th ...

  7. 5 Techniques To Understand Machine Learning Algorithms Without the Background in Mathematics

    5 Techniques To Understand Machine Learning Algorithms Without the Background in Mathematics Where d ...

  8. Algorithms & Data structures in C++& GO ( Lock Free Queue)

    https://github.com/xtaci/algorithms //已实现 ( Implemented ): Array shuffle https://github.com/xtaci/al ...

  9. PaperRead - Comparison of Fundamental Mesh Smoothing Algorithms for Medical Surface Models

    几种常见平滑算法的实现可以参见: 几种网格平滑算法的实现 - Jumanco&Hide - 博客园 (cnblogs.com) 1 Introduction 图像空间中相关的组织和结构,变换成 ...

随机推荐

  1. ANGULAR JS WATCH监听使用

    ANGULAR 监听使用: 当angular数据模型发生变化时,我们需要如果需要根据他的变化触发其他的事件. $watch是一个scope函数,用于监听模型变化,当你的模型部分发生变化时它会通知你. ...

  2. MySQL为数据表的指定字段插入数据

    username not null 没有默认值/有默认值   insert不插入username字段 均不报错 2014年07月23日21:05    百科369 MySQL为数据表的指定字段插入数据 ...

  3. ZOJ 3645 BiliBili 高斯消元 难度:1

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4835 由题意,有: (x1-x11)^2 + (x2-x12)^2 ... = ...

  4. [vijos P1531] 食物链

    做出的第一道NOI题目?(噗,还是看题解才会的…按某篇解题说的,这题就比我年轻四岁…T T 做的第一道IOI题目是USACO上的Packing Rectangles...这题比我还老!)对我等弱渣来说 ...

  5. 使用Myeclipse创建自定义签名debug keystore

    1.在已经创建后的android项目上右击鼠标,如图所示 2.选择next下一步 3.选择create new keystore 注意  这里密码要输入android 4.点击next,录入基本信息 ...

  6. 端午小长假--前端基础学起来03CSS为网页添加样式

    定义:用于定义HTML内容在浏览器内的显示样式,如文字大小,颜色,字体 设置样式:将要设置样式的内容用<span></span>样式括起来,然后再head中设置span < ...

  7. S5PV210之beep-bus模型 linux3.0.8驱动

    目录: 一. bus-driver-device模型 二. 运行结果,及错误解决 三. 怎样利用以有的driver device驱动来写自已的beep-driver-device 驱动       四 ...

  8. BT3入门之中文语言支持

    汉化: 1.更新软件库:apt-get update 2.安装中文语言包:apt-get install language-support-zh   apt-get install language- ...

  9. Windows 8.1 Update 2更新了什么?

    Windows 8.1的第二个更新将于8月12日(周二补丁日)发布,官方命名是“8月更新”(August Update).但是之前我们已经知道Windows 8.1 Update 2不可能重新提供开始 ...

  10. 面向对象之prototype,__proto__

    var person = function(name) { this.name = name }; person.prototype.getName = function() { return thi ...