-
Updated
Mar 25, 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 7,657 public repositories matching this topic...
对于数组[1, 2, 3, 4] 和 [4, 3, 2, 1] 你的冒泡排序算法是否都能获得不错的效率?
-
Updated
Mar 6, 2020 - Swift
-
Updated
Mar 18, 2020 - C++
Describe the bug
When doing reconciliation, I sometimes manually match entries to Wikidata items using "Search for match". I choose the correct match but the match is applied to all entries with the same name because the radio button "Match other cells with same content" is always ticked by default. Even if I change it, next time this button will again be ticked.
Expected behavior
-
Updated
Feb 27, 2020 - Java
The documentation of the boltons.timeutils.daterange function only mention date objects as input, but I discovered that it works with datetime objects as well. Explicitly stating so would be great. Thanks!
-
Updated
Mar 27, 2020 - JavaScript
-
Updated
Mar 24, 2020 - C++
左/右位移沒有解釋UB的情況
this:
!!! warning 我们平常写的除法是向 0 取整,而这里的右移是向下取整(注意这里的区别),即当数大于等于 0 时两种方法等价,当数小于 0 时会有区别,如: $-1 \div 2 = 0$ , 而 $-1 >> 1 = -1$
C++標準裡左/右位移(x << y/x >> y)僅對於x為非負數且結果可表示時有定義值,不然是UB: https://stackoverflow.com/a/8416000
在UB下編譯器可以假設x為非負數而進行優化, 例如有foo(int x) { if (x >= 0) printf("Kaboom!"); int y= x<<4; }, 在-O2以上`foo(-
-
Updated
Oct 26, 2019 - Python
-
Updated
Mar 26, 2020 - C++
-
Updated
Feb 8, 2020
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
Mar 14, 2020 - Swift
-
Updated
Oct 26, 2019 - JavaScript
Given an array consists of non-negative integers, your task is to count the number of triplets chosen from the array that can make triangles if we take them as side lengths of a triangle.
Example 1:
Input: [2,2,3,4]
Output: 3
Explanation:
Valid combinations are:
2,3,4 (using the first 2)
2,3,4 (using the second 2)
2,2,3
Note:
- The len
-
Updated
Mar 25, 2020
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
Aug 18, 2018 - JavaScript
It is possible that hash_b will return 0, reducing the second term to 0. This will cause the hash table to try to insert the item into the same bucket over and over. We can mitigate this by adding 1 to the result of the second hash, making sure it's never 0.
index = hash_a(string) + i * (hash_b(string) + 1) % num_buckets
hash_b(string) + 1 will never be 0, but it may end up having the
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
Feb 28, 2020 - Rust
-
Updated
Mar 13, 2020 - TypeScript
-
Updated
Mar 24, 2020 - JavaScript
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
Oct 6, 2018 - Go
This is about
AvlTree.js-rotateLeftLeft,rotateRightRightmethodrotateLeftLeft should be call 'caseLeftLeft' or 'rotateRightRight'.
Because base on the image on avi tree
readme.md,rotateLeftLeftmethod is a right-right rotation.