What are the 10 algorithms one must know in order to solve most algorithm challenges/puzzles?
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?的更多相关文章
- 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 ...
- 转:Top 10 Algorithms for Coding Interview
The following are top 10 algorithms related concepts in coding interview. I will try to illustrate t ...
- 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 ...
- 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 ...
- [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 ...
- 机器学习算法之旅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 ...
- 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 ...
- Algorithms & Data structures in C++& GO ( Lock Free Queue)
https://github.com/xtaci/algorithms //已实现 ( Implemented ): Array shuffle https://github.com/xtaci/al ...
- PaperRead - Comparison of Fundamental Mesh Smoothing Algorithms for Medical Surface Models
几种常见平滑算法的实现可以参见: 几种网格平滑算法的实现 - Jumanco&Hide - 博客园 (cnblogs.com) 1 Introduction 图像空间中相关的组织和结构,变换成 ...
随机推荐
- PHP分页类库
<?php /** * @title: Ekcms page分页类库 * @version: 1.0 * @author: perry <perry@1kyou.com> * @pu ...
- oracle之to_char,to_date用法
[转载自]http://www.jb51.net/article/45591.htm 这篇文章主要介绍了oracle中to_date详细用法示例,包括期和字符转换函数用法.字符串和时间互转.求某天是星 ...
- subString用法,字符串保持一定位数,不足补0
Substrinig(a,b): 从下标a开始截取,共截取b位 实现:一串数字,中间两位数字+2,生成新的一串数字 "; , number.Length - );//前8位 );//后6位 ...
- 为ASP.NET MVC应用添加自定义路由
这里,我们将学习如何给asp.net mvc应用添加自定义路由.用自定义路由来修改默认路由表. 对一些简单的asp.net mvc应用,默认的路由表就已经足够了.但是,当你需要创建特殊的路由时,就需要 ...
- JQery w3school学习第一章 标签的隐藏和显示
鄙人初学JQuery,最关键的是JQuery获取标签对象的方式 这一章学习的是点击按钮让所有标签的文字以及标签栏的位置隐藏起来,因为单纯的隐藏文字,还是会有空格和空行的影响 这里最关键的代码就是 $( ...
- tomcat http 文件下载
tomcat作为http的下载服务器,网上有很多办法 但我认为最简单的是: 1.直接把文件放在 tomcat6/webapps/ROOT 目录下, 2.然后在网址中访问: http://120.194 ...
- eval函数的缺陷
1.今天在维护产品目录的时候,发现了个奇葩的事情,eval函数转换出错,查验之后发现字符串中如果加入了换行符就会导致该问题. 2.测试程序 info.file [{productDirIds:'1', ...
- 在shell脚本中使用函数
转载请标明:http://www.cnblogs.com/winifred-tang94/ 对于在脚本中重复使用的功能模块,可以封装成为函数. shell脚本中函数的定义可以使用如下两种方式: a. ...
- Python开发入门与实战2-第一个Django项目
2.第一个Django项目 上一章节我们完成了python,django和数据库等运行环境的安装,现在我们来创建第一个django project吧,迈出使用django开发应用的第一步. 2.1.创 ...
- php获取远程文件大小
获取本地文件大小filesize()就可以了,但是如何获取远程文件的大小呢? 这里介绍三个方法来获取远程文件的大小. 方法1:get_headers <?php get_headers($url ...