LeetCode OJ Insertion Sort List
来源:互联网 发布:淘宝网店在哪里看 编辑:程序博客网 时间:2024/05/30 05:41
Sort a linked list using insertion sort.
class Solution {public: ListNode *insertionSortList(ListNode *head) { for (ListNode *temp_1 = head; temp_1 != NULL; temp_1 = temp_1->next) { int min = temp_1->val; ListNode *remem = temp_1; for (ListNode *temp_2 = temp_1->next; temp_2 != NULL; temp_2 = temp_2->next) { if (temp_2->val < min) { min = temp_2->val; remem = temp_2; } } remem->val = temp_1->val; temp_1->val = min; } return head; }};
0 0
- LeetCode OJ:Insertion Sort List
- [LeetCode OJ]Insertion Sort List
- LeetCode OJ Insertion Sort List
- Insertion Sort List leetcode oj
- [LeetCode OJ] Insertion Sort List 解题报告
- Insertion Sort List | leetcode
- Leetcode: Insertion Sort List
- [LeetCode] Insertion Sort List
- Leetcode: Insertion Sort List
- leetcode-Insertion Sort List
- [LeetCode]Insertion Sort List
- 【LeetCode】Insertion Sort List
- LeetCode | Insertion Sort List
- LeetCode - Insertion Sort List
- [LeetCode] Insertion Sort List
- Insertion Sort List (LeetCode)
- [LeetCode] Insertion Sort List
- [LeetCode]Insertion Sort List
- LeetCode OJ Reverse Linked List II
- LeetCode OJ Linked List Cycle II
- 每个Java程序员必须知道的5个JVM命令行标志
- LeetCode OJ Linked List Cycle
- leetcode 之Rotate Array
- LeetCode OJ Insertion Sort List
- LeetCode OJ Sort List
- LeetCode OJ Max Points on a Line
- hdu 4463 Outlets(最小生成树)
- linux 下实线文件切割--split
- LeetCode OJ Remove Duplicates from Sorted List II
- 如何让基于对话框的MFC程序一运行起来就完全隐藏
- LeetCode OJ 3Sum Closest
- LeetCode OJ Evaluate Reverse Polish Notation