-
Updated
Mar 21, 2020
Algorithm
Algorithms are detailed sets of guidelines created for a computer program to complete tasks efficiently and thoroughly.
Here are 7,890 public repositories matching this topic...
-
Updated
Mar 20, 2020 - Java
This is about AvlTree.js - rotateLeftLeft, rotateRightRight method
rotateLeftLeft should be call 'caseLeftLeft' or 'rotateRightRight'.
Because base on the image on avi tree readme.md, rotateLeftLeft method is a right-right rotation.
The heap.png image in the readme (https://raw.githubusercontent.com/kdn251/interviews/master/images/heap.png) shows a tree that does indeed respect the heap order property. The problem is when you mention the time complexities. In order to have O(log(n)) insert / remove time you also need for your heap to be a complete binary tree. The heap in the picture is not a complete binary tree. I think it
Hey Yangshun,
Thanks for the great list of guides!
I found the explanation for Snake game bit difficult to follow and I came across this interesting and better explanantion here https://www.youtube.com/watch?v=AaGK-fj-BAM
Selection Sort, for example, makes the algorithm look extremely (impossibly) good at first glance - O(n) - because it's not showing the majority of the steps.
Instead of
for (var j = i + 1; j < D.length; j++) {
if (D[j] < D[minJ]) {
tracer._select(j);
minJ = j;
tracer._deselect(j);
}
}
it has to be more like
for (var j
有一幅以二维整数数组表示的图画,每一个整数表示该图画的像素值大小,数值在 0 到 65535 之间。
给你一个坐标 (sr, sc) 表示图像渲染开始的像素值(行 ,列)和一个新的颜色值 newColor,让你重新上色这幅图像。
为了完成上色工作,从初始坐标开始,记录初始坐标的上下左右四个方向上像素值与初始坐标相同的相连像素点,接着再记录这四个方向上符合条件的像素点与他们对应四个方向上像素值与初始坐标相同的相连像素点,……,重复该过程。将所有有记录的像素点的颜色值改为新的颜色值。
最后返回经过上色渲染后的图像。
示例 1:
输入:
image = [[1,1,1],[1,1,0],[1,0,1]]
sr = 1, sc = 1, newColor = 2
输出: [[2,2,2],[2,2,0],[2,0,1]]
解析:
在图像的正中间,(坐标(
-
Updated
Jan 15, 2020 - Java
https://mybinder.org/ Should I make a binder ? :) Or if there is a binder link, it's well hidden.
nice project and helps me a lot :)
I found that this repo only offered the questions and their solutions (code). Without some extra explanation, it's not quite easy to understand the algorithms for the beginner.
any suggestions or plan?
-
Updated
Mar 18, 2020 - C#
-
Updated
Dec 29, 2019 - Jupyter Notebook
there is data_structures/src/list/singly_linked_list, but there is also a code for same problem in data_structures/linked_list/
One of them ought to be removed.
-
Updated
Jul 17, 2019 - Python
-
Updated
Mar 18, 2020 - C++
-
Updated
Mar 20, 2020 - Jupyter Notebook
-
Updated
Mar 12, 2020 - Java
Chapter 12, Section 11, Hamiltonian Cycle
Page number: 400
"doubly-linked list of 2k vertices (i, 0),(i, 1),...,(i, 2k)" should have no "(i, 0)".
Hey @mgechev,
I noticed that you have a README.md file in src/sorting, which has the Big O complexity for all algorithms. It also has the "When to use" column, which is blank. Basecs already has many algorithms' explanations, and can be used to fill in this.column. The explanations are valid for most languages and are concise.
Also, a README.md for all src/* folders would be helpful. (I would
-
Updated
Jan 14, 2020 - HTML
🚀 Feature Proposal
Adding leading zero in the question number will be an awesome feature for file explorer to sort files by the name.
Here's a JSFiddle and a sample geojson.
Basically, if I have a LineString of length k, calling lineToPolygon(line) (which returns a "new" polygon) also mutates line to have k + 1 points. Of course, you can set the property autoComplete, but I would never expect lineToPolygon(line) to both return a Polygon
-
Updated
Mar 7, 2020 - Python
-
Updated
Mar 11, 2020 - C++
-
Updated
Mar 13, 2020 - Java
Add radix sort
-
Updated
Feb 9, 2020 - C++
-
Updated
Feb 8, 2020
- Wikipedia
- Wikipedia
There are some interesting algorithms in simulation from Physics, Chemistry, and Engineering especially regarding Monte Carlo simulation: Heat Bath algorithm, Metro-Police algorithm, Markov Chain Monte Carlo, etc.