- 博客(6)
- 资源 (8)
- 收藏
- 关注
原创 基础编程题目集 函数题部分
文章目录6-1 简单输出整数 (10分)6-2 多项式求值 (15分)6-3 简单求和 (10分)6-4 求自定类型元素的平均 (10分)6-5 求自定类型元素的最大值 (10分)6-6 求单链表结点的阶乘和 (15分)6-7 统计某类完全平方数 (20分)6-8 简单阶乘计算 (10分)6-9 统计个位数字 (15分)6-12 判断奇偶性 (10分)6-13 折半查找 (15分)做这些简单的题...
2020-01-22 21:24:16 2576
原创 Leetcode C++ 100. Same Tree 【树】easy
Given two binary trees, write a function to check if they are the same or not.Two binary trees are considered the same if they are structurally identical and the nodes have the same value.Example 1...
2020-01-08 20:45:04 282
原创 Leetcode C++ 83. Remove Duplicates from Sorted List【链表】EASY
Given a sorted linked list, delete all duplicates such that each element appear only once.Example 1:Input: 1->1->2Output: 1->2Example 2:Input: 1->1->2->3->3Output: 1-&g...
2020-01-08 00:53:55 187
原创 Leetcode C++ 70. Climbing Stairs 【斐波拉契数列】
You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?Note: Given n will be a positive i...
2020-01-06 21:31:52 421
原创 Leetcode C++ 20. Valid Parentheses 【Stack】
Given a string containing just the characters ‘(’, ‘)’, ‘{’, ‘}’, ‘[’ and ‘]’, determine if the input string is valid.An input string is valid if:Open brackets must be closed by the same type of bra...
2020-01-06 20:42:00 308
原创 单链表反转
无头的单链表反转:迭代实现的话,需要pre和next。相当于把每个结点指向下一个结点的指针箭头指向上一个结点或者空,然后返回指向原链表最后一个结点的指针。ListNode *iterateReverseList(ListNode *l) { ListNode *pre = nullptr, *next; while (l) { next = l->next; // 保存指向原链表...
2020-01-06 20:29:35 167
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人