Ronnyz 
  • 首页
  • 归档
  • 标签
  • 关于
  •   
  •   
JZ58 对称的二叉树

JZ58 对称的二叉树

Solution 递归法 12345678910111213141516171819202122232425/*struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; TreeNode(int x) : val(x), left(NULL)

2021-10-10
algo 二叉树 nowcoder
JZ57 二叉树的下一个结点

JZ57 二叉树的下一个结点

Solution 12345678910111213141516171819202122232425262728/*struct TreeLinkNode { int val; struct TreeLinkNode *left; struct TreeLinkNode *right; struct TreeLinkNode *next; TreeL

2021-10-10
algo 二叉树 nowcoder
JZ56 删除链表中重复的结点

JZ56 删除链表中重复的结点

Solution 借助栈 123456789101112131415161718192021222324252627282930313233343536373839/*struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) &#

2021-10-10
algo 链表 nowcoder
JZ55 链表中环的入口结点

JZ55 链表中环的入口结点

Solution 快慢指针 1234567891011121314151617181920212223242526272829/*struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { }}

2021-10-10
algo 链表 nowcoder
JZ54 字符流中第一个不重复的字符

JZ54 字符流中第一个不重复的字符

Solution 12345678910111213141516171819class Solution{public: //Insert one char from stringstream void Insert(char ch) { v.push_back(ch); umap[ch]++; } //retur

2021-10-10
algo 字符串 nowcoder
JZ53 表示数值的字符串

JZ53 表示数值的字符串

Solution 12345678910111213141516171819202122232425262728293031323334353637383940414243class Solution {public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param str s

2021-10-10
algo 字符串 nowcoder
JZ52 正则表达式匹配

JZ52 正则表达式匹配

Solution 123456789101112131415161718192021222324252627class Solution {public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param str string字符串 * @param pattern s

2021-10-10
algo 字符串 nowcoder
JZ51 构建乘积数组

JZ51 构建乘积数组

Solution 123456789101112131415161718class Solution {public: vector<int> multiply(const vector<int>& A) { int n = A.size(); vector<int> left(n+1, 1)

2021-10-10
algo nowcoder 数组
JZ50 数组中重复的数字

JZ50 数组中重复的数字

Solution 利用数组来保存出现次数 123456789101112131415161718192021class Solution {public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param numbers int整型vector * @return

2021-10-10
algo nowcoder 数组
JZ49 把字符串转换成整数

JZ49 把字符串转换成整数

Solution 123456789101112131415161718192021222324class Solution {public: int StrToInt(string str) { int len = str.size(); if (len == 0) return 0; long res = 0, fla

2021-10-10
algo 字符串 nowcoder
12345…46

搜索

正在加载今日诗词....
Hexo Fluid
赣ICP备2022002978号 | police-icon 赣公网安备36082302000115号