Rust-04 Ownership Description Sample Code mutable reference &mut varible_name reference &varible_name Rust中会对变量增加一个所有权的概念,即,变量被声明时,所分配的内存(包括栈(stack)上分配和堆(heap)上分配的变量)归当前变量所有。一旦变量超出其作用域后便会将分配的内存释放掉。 12 2023-01-13 Tutorial > Rust #Programming Language
Rust-07 HashMap HashMapstd::collections::hash_map::Entry访问HashMap的元素,提供有or_default方法来获取没有存在的key,并对其设置默认值。也可以使用or_insert对没有存在的key进行值的设置 123456789use std::collections::HashMap;let mut map: HashMap<&str, u32> 2022-12-30 Tutorial > Rust #Programming Language
Markdown Notes HeadingUse -/=we can use -/= tag to specify a heading. - represents the two level heading and = represents the one level heading. There are only two levels heading with this way. 12345heading1 with `- 2022-09-16
LeetCode-672. Bulb Switcher II DescriptionThere is a room with n bulbs labeled from 1 to n that all are turned on initially, and four buttons on the wall. Each of the four buttons has a different functionality where: Button 1: Fli 2022-09-15 Algorithms > LeetCode #Algorithms
Rust-05 Vec VecVec is a contiguous growable array type. 1234pub struct Vec<T, A = Global>where A: Allocator, { ... } ExamplesWe can declare a mutable/immutable Vec by Vec::new() 12let mut 2022-08-07 Tutorial > Rust #Programming Language
LeetCode-540 Single Element in a Sorted Array DescriptionYou are given a sorted array consisting of only integers where every element appears exactly twice, except for one element which appears exactly once. Return the single element that appea 2022-02-14 Algorithms > LeetCode #Algorithms
Redis Notes-05 Redis中的布隆过滤器(BloomFilter)Redis官方在4.0版本中提供了插件功能,此时可以将rebloom作为插件加载到Redis Server中,给Redis提供布隆去重功能。 123docker pull redislab/rebloomdocker run -p 6739:6739 redislab/rebloomredis-cli 1234567891011121314# 插 2022-01-18 Notes > Redis #Notes