LEETCODE
无用理想家
废物一个
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
[LEETCODE June Challenge] 04 Reverse String
Problem Description Write a function that reverses a string. The input string is given as an array of characters char[]. Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory. You may原创 2020-06-04 15:48:20 · 178 阅读 · 0 评论 -
[LEETCODE June Challenge] 03 Two City Scheduling
Problem Description There are 2N people a company is planning to interview. The cost of flying the i-th person to city A is costs[i][0], and the cost of flying the i-th person to city B is costs[i][1]. Return the minimum cost to fly every person to a city原创 2020-06-04 13:11:55 · 184 阅读 · 0 评论 -
[LEETCODE June Challenge] 02 Delete Node in a Linked List
其实这次没太看懂题目啊 那个函数输入的是要删除的节点还是头节点啊好郁闷 就当作删除的节点来写了没想到ok的?(小声 啊数据结构这玩意真的该复习一波了orz Problem Description Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. /** * Definition for singly-linked list. * stru原创 2020-06-02 17:25:11 · 132 阅读 · 0 评论 -
[LEETCODE June Challenge] 01 Invert Binary Tree
<c艹复健期间 改用c艹刷leetcode> Invert Binary Tree Problem Description Solution 遍历树的话就前序遍历,先访问根节点再左子树然后右子树。对左右节点进行交换,就设一个中间量然后互换。(emmmmm好像没啥好说的就这样 void swap(TreeNode *curr) { if(!curr) return; swap(curr->left); swap(cu原创 2020-06-02 11:38:51 · 146 阅读 · 0 评论
分享