结构体定义
- 基础定义:
struct User {
int Id;
int followeeId;
struct User* next;
}
- typedef定义:
typedef struct User {
int Id;
int followeeId;
struct User* next;
} AnotherUser;
AnotherUser相当于struct User的别名,因为在定义结构体指针next时,代码还没编译到AnotherUser,所以在定义结构体指针时,需要将结构体名称写全,不能直接用别名。User其实是结构体中是一个标签,可以省略
-
设计推特 https://leetcode-cn.com/problems/design-twitter/ 设计类
面试题 17.07. 婴儿名字https://leetcode-cn.com/problems/baby-names-lcci/ 并查集
面试题 16.16. 部分排序 https://leetcode-cn.com/problems/sub-sort-lcci/ -
每日温度
面试题 16.02. 单词频率
面试题 17.22. 单词转换