LeetCode of algorithms with Java solution 二分查找 [704] Binary Search [441...
投稿
收錄了7篇文章 · 1人關注
LeetCode of algorithms with Java solution 二分查找 [704] Binary Search [441...
不重疊的區(qū)間個數(shù) Input: [ [1,2], [1,2], [1,2] ] Output: 2 Explanation: You need ...
投飛鏢刺破氣球 Input:[[10,16], [2,8], [1,6], [7,12]] Output:2 題目描述:氣球在一個水平數(shù)軸上擺放...
按顏色進行排序 Input: [2,0,2,1,1,0]Output: [0,0,1,1,2,2] 中心思想:三向切分快速排序 用兩個指針lef...
判斷鏈表是否存在環(huán) 使用雙指針,一個指針每次移動一個節(jié)點,一個指針每次移動兩個節(jié)點,如果存在環(huán),那么這兩個指針一定會相遇。
刪除鏈表的倒數(shù)第 n 個節(jié)點 Given linked list: 1->2->3->4->5, and n = 2.After removin...
歸并兩個有序的鏈表 21. Merge Two Sorted Lists (Easy)