1. 链表
链表逆转
1 class Solution { 2 public: 3 ListNode* reverseList(ListNode* head) { 4 ListNode* prev = NULL; 5 while (head != NULL) { 6 ListNode* next = head->next; 7 head->next = prev; 8 prev = head; 9 head = next; 10 } 11 return prev; 12 } 13 };
findMiddle
树的前中后序遍历
堆排序
快排
时间: 2024-10-05 08:59:45