JavaScript的数据结构库 [英] javascript data structures library

查看:139
本文介绍了JavaScript的数据结构库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想问一下对于提供一些基本的数据结构的实现,如优先级队列的JavaScript库/库的建议,任意键地图,尝试,图表等以及一些算法,对它们进行操作

I'd like to ask for recommendation of JavaScript library/libraries that supply an implementation of some basic data structures such as a priority queue, map with arbitrary keys, tries, graphs, etc. along with some algorithms that operate on them.

我最感兴趣的是:

  • 在该组涵盖的功能,
  • 解决方案的灵活性 - 这主要适用于图形。比如我必须使用所提供的图形执行,
  • 使用的语言的功能特性 - 这又有时会具有更大的灵活性,
  • 实施效果

修改

好吧,我想指出的是,我知道,这是有可能实现使用JS以下数据结构:

Ok, I'd like to point out that I'm aware that it's possible to implement using js the following data structures:

  • 的地图,如果key值是字符串或数字,
  • 在一组,(使用地图实现),
  • 系统队列,但正如指出的下方,这是低效的一些浏览器,

目前,我最感兴趣的是优先级队列(不与常规的队列混淆),图中实现,是不是很麻烦,因为在输入图形的格式。例如,它们可以使用回调来遍历图的结构,而不是用固定名称访问某些具体属性

At the moment I'm mostly interested in priority queues (not to confuse with regular queues), graph implementations that aren't very intrusive as to the format of the input graph. For example they could use callbacks to traverse the structure of the graph rather than access some concrete properties with fixed names.

推荐答案

我推荐使用Closure库(尤其是封闭的编译器)。

I recommend to use Closure Library (especially with closure compiler).

在这里,你有一个数据结构 goog库。结构的。 该库包含:

Here you have a library with data structures goog.structs. The library contains:

goog.structs.AvlTree
goog.structs.CircularBuffer
goog.structs.Heap
goog.structs.InversionMap
goog.structs.LinkedMap
goog.structs.Map
goog.structs.PriorityQueue
goog.structs.Set

作为例子,你可以使用单元测试:<一href="https://closure-library.google$c$c.com/git-history/docs/local_closure_goog_structs_priorityqueue_test.js.source.html"相对=nofollow> goog.structs.PriorityQueueTest 。

如果您需要处理阵列,另外还有一个数组lib目录下:<一href="https://closure-library.google$c$c.com/git-history/docs/local_closure_goog_array_array.js.source.html"相对=nofollow> goog.array 。

If you need to work on arrays, there's also an array lib: goog.array.

正如评论指出,源已经转移到 github.com/google/closure 和文档的新位置是: google.github.io/closure-library

As noted in comments, the source has moved to github.com/google/closure and the documentation's new location is: google.github.io/closure-library.

这篇关于JavaScript的数据结构库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆