上一页 1 2 3 4 5 6 7 8 ··· 18 下一页
摘要: int search(vector<int>& nums, int target) { int left = 0; int right = nums.size(); if (right == 0) { return -1; } bool flag = false; while (left<right 阅读全文
posted @ 2021-03-18 09:59 唯一诺 阅读(58) 评论(0) 推荐(0)
摘要: 1.final 当希望类不被继承或者虚函数不被重写时,可以在类名后面或者函数后面使用final修改; 2.override 当表明此函数是重写而来时,可以用override修饰,此时编译器会检查是否为重写的函数; 阅读全文
posted @ 2021-03-17 08:35 唯一诺 阅读(159) 评论(0) 推荐(0)
摘要: Node* reveser(Node *head) { if (head == NULL) { return NULL; } Node* pre = NULL; Node* next = NULL; while (head != NULL) { next = head->next; head->ne 阅读全文
posted @ 2021-03-11 20:40 唯一诺 阅读(65) 评论(0) 推荐(0)
摘要: bool checkArr(char * arr, int len, int* max) { if (NULL == arr || len == 0 || max == NULL) { return false; } int maxdepth = 0, deep = 0; for (int i = 阅读全文
posted @ 2021-03-11 19:27 唯一诺 阅读(43) 评论(0) 推荐(0)
摘要: bool testFunc(int k) { char kai[] = { 1, 2, 1, 3, 4, 5, 1 }; int size = sizeof(kai); for (int i = 0; i < size; i++) { for (int j = 1; j <= k; j++) { i 阅读全文
posted @ 2021-03-11 11:20 唯一诺 阅读(71) 评论(0) 推荐(0)
摘要: ListNode* ReverseList(ListNode* head, ListNode* tail) { ListNode* pre = NULL; ListNode* next = NULL; while (head != tail) { next = head->next; head->n 阅读全文
posted @ 2021-03-10 19:06 唯一诺 阅读(62) 评论(0) 推荐(0)
摘要: int main(){ int arr[] = {4,2,3,5,6}; int n = sizeof(arr) / sizeof(int); int t = 0; for (int i = 1; i <= n+1; i++) { t ^= i; } for (int i = 0; i < n; i 阅读全文
posted @ 2021-03-05 09:08 唯一诺 阅读(732) 评论(0) 推荐(0)
摘要: ListNode* ReverseList(ListNode* pHead) { if (pHead == NULL) { return NULL; } ListNode pHeadNew(0); pHeadNew.next = pHead; ListNode* curNode = pHead; L 阅读全文
posted @ 2021-03-03 13:57 唯一诺 阅读(38) 评论(0) 推荐(0)
摘要: https://www.cnblogs.com/ooo0/p/12161786.html 值得一再强调的是,空间复杂度是根据额外需要的内存空间(也叫辅助空间)来算的,也就是说原本的数据不纳入计算。 尽管在第二个版本里我们有array这一入参,占用了N个元素的空间,但除此之外它并没有消耗额外的内存,所 阅读全文
posted @ 2021-03-02 20:18 唯一诺 阅读(100) 评论(0) 推荐(0)
摘要: __attribute__((constructor)) void before() { printf("this is main before\n"); } __attribute__((destructor)) void after() { printf("this is main after\ 阅读全文
posted @ 2021-03-02 09:05 唯一诺 阅读(629) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 18 下一页