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. useradd 和groupadd

    1.作用useradd命令用来建立用户帐号和创建用户的起始目录,使用权限是终极用户.2.格式useradd [-d home] [-s shell] [-c comment] [-m [-k temp ...

  2. 解析网络json数据,模拟美团界面显示。

    <?xml version="1.0" encoding="UTF-8"?> <RelativeLayout xmlns:android=&q ...

  3. C#.NET SQL数据库备份与还原解决方案

    C#.NET SQL数据库备份与还原解决方案http://www.csframework.com/archive/1/arc-1-20110924-1841.htm 开发框架V2.2(快速开发版)系统 ...

  4. js继承实例

    第一种方法:对象冒充(临时属性) 借用临时属性,指向超类,末了删除 function Person(name,gender){ this.name=name; this.gender=gender; ...

  5. linux下安装vtune_amplifier_xe_2015_update4

    说明:        linux系统: CentOS 6.0 Vtune版本: 2015 安装过程: 1.下载vtune_amplifier_xe_2015_update4.tar.gz(到官网去下载 ...

  6. php判断用户浏览器类型是否为微信浏览器

    PHP方法:利用PHP的“_SERVER ”数组“HTTP_USER_AGENT”项,获取该页面的用户代理的信息,来完成这个工作. [winows/chrome] 输出结果: Mozilla/5.0 ...

  7. 根据图片Uri获得图片文件

    2013-12-17 1. 根据联系人图片Uri获得图片文件并将它显示在ImageView上, 代码如下: Uri uri = Uri.parse("content://com.androi ...

  8. [USACO精选] 第一章 数值计算

    好不容易坑来了传说中的USACO精选,近100题我要是能做完就哈哈哈哈了…继今天学并查集连番受挫之后,决定写一写基础题. #0 负二进制 2014-01-10 其实是想到就会做,不想到就不会做的题,数 ...

  9. Android之sdcard操作

    private static final String FILENAME = "abc.txt"; private static final String DIR = " ...

  10. iOS多语言备选机制

    近期伊书突然接到一些外国用户的投诉,说伊书界面变成了中文,但他们系统语言不是中文,是法文俄文日文等,伊书只支持中文跟英文,在不支持系统所用语言的时候,理应会自动选用英文,不知为什么会选成了中文,经过艰 ...