bst:基于二叉搜索树(BST)的映射和集合类型-源码

上传者: 42125826 | 上传时间: 2021-07-09 15:26:24 | 文件大小: 72KB | 文件类型: ZIP
二进制搜索树(BST) 该库基于二进制搜索树实现映射类型BSTMap和集合类型BSTSet 。 该API的用途与HashMap / HashSet和BTreeMap / BTreeSet等类型相似,同时还提供了使用较低级别的root和root_mut方法实现自己的遍历的功能。 这些数据结构不是由每个节点执行分配,而是由竞技场分配器支持,竞技场分配器仅偶尔分配以增加其容量。 竞技场以块为单位分配内存,而不会使之前产生的任何地址无效。 这对于插入性能非常有用,因为我们每次需要更多空间时都不必复制和更新所有先前分配的节点。 您正在操作的节点也很有可能连续放置在内存中,这非常适合缓存局部性。 root和root_mut方法返回的类型提供了left和right方法,以便在树中方便且直观地遍历。 几乎感觉就像您希望用垃圾回收语言编写的树API,但没有额外的开销,并且具有Rust借用检查器的所有常

文件下载

资源详情

[{"title":"( 36 个子文件 72KB ) bst:基于二叉搜索树(BST)的映射和集合类型-源码","children":[{"title":"bst-master","children":[{"title":"Cargo.toml <span style='color:#111;'> 749B </span>","children":null,"spread":false},{"title":".github","children":[{"title":"workflows","children":[{"title":"rust.yml <span style='color:#111;'> 1.38KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"simple_bst","children":[{"title":"Cargo.toml <span style='color:#111;'> 309B </span>","children":null,"spread":false},{"title":"src","children":[{"title":"set.rs <span style='color:#111;'> 16.21KB </span>","children":null,"spread":false},{"title":"set","children":[{"title":"postorder.rs <span style='color:#111;'> 538B </span>","children":null,"spread":false},{"title":"inorder.rs <span style='color:#111;'> 526B </span>","children":null,"spread":false},{"title":"node.rs <span style='color:#111;'> 1.29KB </span>","children":null,"spread":false},{"title":"preorder.rs <span style='color:#111;'> 532B </span>","children":null,"spread":false}],"spread":true},{"title":"map.rs <span style='color:#111;'> 35.51KB </span>","children":null,"spread":false},{"title":"lib.rs <span style='color:#111;'> 121B </span>","children":null,"spread":false},{"title":"map","children":[{"title":"postorder.rs <span style='color:#111;'> 1.97KB </span>","children":null,"spread":false},{"title":"inorder.rs <span style='color:#111;'> 1.06KB </span>","children":null,"spread":false},{"title":"node.rs <span style='color:#111;'> 2.13KB </span>","children":null,"spread":false},{"title":"preorder.rs <span style='color:#111;'> 732B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"src","children":[{"title":"set.rs <span style='color:#111;'> 18.37KB </span>","children":null,"spread":false},{"title":"set","children":[{"title":"postorder.rs <span style='color:#111;'> 532B </span>","children":null,"spread":false},{"title":"inorder.rs <span style='color:#111;'> 520B </span>","children":null,"spread":false},{"title":"node.rs <span style='color:#111;'> 1.29KB </span>","children":null,"spread":false},{"title":"preorder.rs <span style='color:#111;'> 526B </span>","children":null,"spread":false}],"spread":true},{"title":"map.rs <span style='color:#111;'> 38.85KB </span>","children":null,"spread":false},{"title":"lib.rs <span style='color:#111;'> 2.33KB </span>","children":null,"spread":false},{"title":"map","children":[{"title":"postorder.rs <span style='color:#111;'> 2.48KB </span>","children":null,"spread":false},{"title":"inorder.rs <span style='color:#111;'> 1.56KB </span>","children":null,"spread":false},{"title":"node.rs <span style='color:#111;'> 7.71KB </span>","children":null,"spread":false},{"title":"preorder.rs <span style='color:#111;'> 994B </span>","children":null,"spread":false}],"spread":true},{"title":"slab.rs <span style='color:#111;'> 21.08KB </span>","children":null,"spread":false},{"title":"arena.rs <span style='color:#111;'> 31.93KB </span>","children":null,"spread":false}],"spread":true},{"title":"LICENSE <span style='color:#111;'> 16.33KB </span>","children":null,"spread":false},{"title":"README.md <span style='color:#111;'> 4.89KB </span>","children":null,"spread":false},{"title":".gitignore <span style='color:#111;'> 19B </span>","children":null,"spread":false},{"title":"benches","children":[{"title":"map_comparison.rs <span style='color:#111;'> 13.37KB </span>","children":null,"spread":false},{"title":"two_sum.rs <span style='color:#111;'> 4.84KB </span>","children":null,"spread":false},{"title":"name_resolution.rs <span style='color:#111;'> 8.40KB </span>","children":null,"spread":false},{"title":"movie_requests.rs <span style='color:#111;'> 4.95KB </span>","children":null,"spread":false},{"title":"web_server.rs <span style='color:#111;'> 11.52KB </span>","children":null,"spread":false},{"title":"set_comparison.rs <span style='color:#111;'> 10.67KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明