Skip to content
#

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...

VojtechDostal
VojtechDostal commented Feb 19, 2020

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

Voileexperiments
Voileexperiments commented Mar 4, 2019

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(-

grandyang
grandyang commented May 30, 2019

 

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:

  1. The len
tinco
tinco commented Oct 15, 2019

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.

alcides
alcides commented Aug 24, 2017

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

ceki
ceki commented Nov 19, 2019

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

📚 collection of JavaScript and TypeScript data structures and algorithms for education purposes. Source code bundle of JavaScript algorithms and data structures book

  • Updated Mar 13, 2020
  • TypeScript
Wikipedia
Wikipedia

Related Topics

algorithm
You can’t perform that action at this time.