摘要:
```C++ class Solution { public: void Mirror(TreeNode *pRoot) { if(pRoot == nullptr) return; cout val left; pRoot->left = pRoot->right; pRoot->right = temp; ... 阅读全文
摘要:
参考:https://www.cnblogs.com/xudong bupt/p/3509567.html 尽量使用const以增加程序的鲁棒性 修饰函数体的时候: 可以使成员函数无法修改成员变量。 阅读全文
摘要:
```C++
class Solution {
public: bool isSame(TreeNode* a, TreeNode* b) { if (a != nullptr && b != nullptr) { if (a->val == b->val) { return isSame(a->left, b->le... 阅读全文
摘要:
```C++ class Solution { public: ListNode* Merge(ListNode* pHead1, ListNode* pHead2) { if(pHead1 == nullptr) return pHead2; if(pHead2 == nullptr) return pHead1; ListNode... 阅读全文
摘要:
```C++
class Solution {
public: ListNode* ReverseList(ListNode* pHead) { ListNode* prev = nullptr; ListNode* curr = pHead; while ( curr != nullptr ){ curr = pHe... 阅读全文
摘要:
```C++ class Solution { public: ListNode* FindKthToTail(ListNode* pListHead, unsigned int k) { if(pListHead == nullptr) return nullptr; int len = 0; ListNode* root = pListH... 阅读全文
摘要:
```C++ class Solution { public: void reOrderArray(vector &array) { if(array.empty() || array.size() == 1){ return; } auto end = (int)array.size(); int 阅读全文