A :
1.leetcode sum (Easy) 题目链接 代码
2.leetcode AddTwoNumber (Medium) 题目链接 代码
3.leetcode LongestSubstringWithoutRepeatingCharacters(Medium) 题目链接 代码
R : 不是技术文章。主要为了提升英语水平
文章地址
翻译
T :
学习内容 :用指针表示链表
//定义
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
用指向结构体的指针来进行操作
ListNode* head = new ListNode(-1) ;
//head是头指针,不存储实际的数据
链表的插入
ListNode *p = new ListNode(0) , *q = new ListNode(0) ;
while (n--){
q = new ListNode(0) ;
cin >> q->val ;
if (head->next == nullptr)
head->next = q ;
else
p->next = q ;
p = q ;
}
if (head->next != nullptr)
q->next = nullptr ;
链表的输出
while (head->next != nullptr){
/*操作*/
head = head->next ;
}
S : 学习使用github
10分钟教你把项目保存到github仓库保管代码
虽然不是英文,但是对我很有帮助