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,446 public repositories matching this topic...

javascript-algorithms
leetcode
azl397985856
azl397985856 commented Feb 5, 2020

假如有一排房子,共 n 个,每个房子可以被粉刷成红色、蓝色或者绿色这三种颜色中的一种,你需要粉刷所有的房子并且使其相邻的两个房子颜色不能相同。

当然,因为市场上不同颜色油漆的价格不同,所以房子粉刷成不同颜色的花费成本也是不同的。每个房子粉刷成不同颜色的花费是以一个 n x 3 的矩阵来表示的。

例如,costs[0][0] 表示第 0 号房子粉刷成红色的成本花费;costs[1][2] 表示第 1 号房子粉刷成绿色的花费,以此类推。请你计算出粉刷完所有房子最少的花费成本。

注意:

所有花费均为正整数。

示例:

输入: [[17,2,17],[16,16,5],[14,3,19]]
输出: 10
解释: 将 0 号房子粉刷成蓝色,1 号房子粉刷成绿色,2 号房子粉刷成蓝色。
  最少花费: 2 + 5 + 3 = 10。

题目地址: ht

antoine2711
antoine2711 commented Feb 10, 2020

Describe the bug
You can't select a different sheet in a gSheet (tabs at the bottom) in a gSheet importation with OR. All the names of the sheets of spreadsheets are there and good, but choosing one of them just make the default one reload.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Create project' -> 'Google Data'
  2. Sign in a Google Account
  3. Choose a gSheet' spread
CBW2007
CBW2007 commented Dec 15, 2019

没错,我来杠自己写的文章【滑稽】

刚刚翻了一下Notepad++ - OI Wiki这个页面,发现GIF或许有碍阅读,一个GIF加载需要较长时间,对于网速慢的同学就是一场灾难

目前可以考虑在GIF之外再写一遍文字,但是GIF还是会占用加载时间;或者页面只保留文字,给一个GIF的链接;再不济只保留文字,删去GIF

欢迎投票:)


[![](https://api.gh-polls.

grandyang
grandyang commented May 30, 2019

 

Reverse a linked list from position  m  to  n. Do it in one-pass.

Note: 1 ≤  m  ≤  n  ≤ length of list.

Example:

Input: 1->2->3->4->5->NULL, _m_ = 2, _n_ = 4
Output: 1- >4->3->2->5->NULL

 

很奇怪为何没有倒置链表之一,就来了这个倒置链表之二,不过猜也能猜得到之一就是单纯的倒置整个链表,而这道作为延伸的地方就是倒置其中的某一小段。对于链表的问题,根据以往的经验一般都是要建一个dummy node,连上原链表的头结点,这样的话就算头结点变动了,我们还可以通过dummy->next来获得新链表的头结点。这道题的要求是只通过一次遍历完成,就拿题目

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.

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 Feb 22, 2020
  • TypeScript
co16353sidak
co16353sidak commented May 8, 2019

instead of keeping one solitary readme I the root folder, it would be better to add separate README to each folder.
what this would achieve would be that for someone interested in ciphers should open the folder and find details in the README specific to ciphers only.
This seems like an easy process of splitting the README into separate duplicates and then adding them to individual folders, I wou

tmac33
tmac33 commented Aug 14, 2019

the block as below

current := list.head
	for current.next != nil {
		if current.next.data == i {
			if current.next.next != nil {
				current.next.next.prev = current
			}
			current.next = current.next.next
			return true
		}
		current = current.next
	}

there should no current.next.next==nil condition, if current.next.next==nil, then current.next will be the list.tail

stefanct
stefanct commented Jan 19, 2020

The documentation gives some hints that the default hashtable and hashset implementation are assuming C strings as keys. However, the "official" documentation use some defines that have been removed in the meantime, i.e. in 9b4c3cb. As of now using the hashing data structures with anything but strings as keys is rather a PITA. There is al

Wikipedia
Wikipedia

Related Topics

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