-
Updated
May 16, 2020
Data structures
A data structure is a particular way storing and organizing data in a computer for efficient access and modification. Data structures are designed for a specific purpose. Examples include arrays, linked lists, and classes.
Here are 8,277 public repositories matching this topic...
-
Updated
May 18, 2020
有一幅以二维整数数组表示的图画,每一个整数表示该图画的像素值大小,数值在 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
May 16, 2020 - Swift
-
Updated
Apr 19, 2020 - C++
Describe the bug
The input field to create a project from a URL does not trim its input when validating it.
To Reproduce
Steps to reproduce the behavior:
- Go to 'Create Project' -> 'Web Addresses (URL)'
- Paste " http://api.worldbank.org/countries/all/indicators/SP.POP.TOTL?date=2000:2001" with the leading whitespac
-
Updated
May 18, 2020 - Java
-
Updated
May 20, 2020 - C++
-
Updated
May 20, 2020 - JavaScript
From: https://boltons.readthedocs.io/en/latest/setutils.html#boltons.setutils.IndexedSet
As you can see, the IndexedSet is almost like a UniqueList, retaining only one copy of a given value, in the order it was first added.
This appears incorrect. Perhaps it is a remnant from an earlier version of the library?
add git 使用指南
首先,十分欢迎你来给 OI WIki 开 issue,在提交之前,请花时间阅读一下这个模板的内容,谢谢合作!
- 希望添加的是什么?
git 使用指南
- 英文叫什么?
git-guidebook
- 有什么参考资料?
https://git-scm.com/docs
https://git-scm.com/book/zh/v2
issue 标题请写为 'add ' + 要添加的内容
然后可以在 htc 里 link 一下。(我刚开始写 Wiki 的时候就不知道怎么做到“一个 pr 只干一件事”)
左/右位移沒有解釋UB的情況
-
Updated
Apr 13, 2020 - Python
-
Updated
Mar 26, 2020 - C++
I'd suggest a better differentiation between Best and Breadth First Search in the Graphs section.
Acronyms BFS and DFS are used all over the place, but "breadth" and "depth" aren't mentioned anywhere, making it hard for a newcomer to understand what is being referred to.
steps to reproduce
Write a loop, from 1 to 80000, each time add a random int to the max heap.
In theory it takes very little time(NlogN, N=80000, <1sec ), but the program does take a long time.
I'v also tested the BinaryHeap in https://github.com/SolutionsDesign/Algorithmia, it performs well, so it is probably due to the bad algorithm.
-
Updated
May 17, 2020 - Swift
Given a blacklist B
containing unique integers from [0, N)
, write a function to return a uniform random integer from [0, N)
which is NOT in B
.
Optimize it such that it minimizes the call to system’s Math.random()
.
Note:
1 <= N <= 1000000000
0 <= B.length < min(100000, N)
[0, N)
does NOT include N. See [interval notation](https://en.wikipedia.org/wiki/Interval_\
-
Updated
Oct 26, 2019 - JavaScript
Hi, I'm not sure if more platforms are interesting to you, but I've made a slightly more complete implementation of padding a struct to the cache line size here:
https://github.com/tinco/cache_line_size
I got the information on the cache line sizes from the Go compiler repository, so I'm pretty sure these are correct for all platforms Go runs on, which is a whole bunch.
-
Updated
May 18, 2020 - JavaScript
-
Updated
Mar 25, 2020
-
Updated
Aug 18, 2018 - JavaScript
It's not easy to understand what the code generators under jctools-build are supposed to do. I think one or two phases documenting their goal would be useful.
I am proposing to document these classes:
- JavaParsingAtomicArrayQueueGenerator.java
- JavaParsingAtomicLinkedQueueGenerator.java
- JavaParsingAtomicQueueGenerator.java
-
Updated
Apr 16, 2020 - TypeScript
-
Updated
Apr 15, 2020 - Rust
Yes, I know I could examine all the headers available, but it'd be nice if each documentation page listed which header(s) you need to include to use it.
-
Updated
May 20, 2020 - Java
https://github.com/trekhleb/javascript-algorithms/blob/master/src/algorithms/sets/cartesian-product/cartesianProduct.js#L8
I think it makes more sense to return an empty array