Sara

  • Home

  • Tags

  • Categories

  • Archives

  • Search

LeetCode_Remove Duplicates from Sorted List

Posted on 2019-02-23 | In LeetCode

Remove Duplicates from Sorted List

Given a sorted linked list, delete all duplicates such that each element appear only once.
(移除链表中的重复元素(所有元素只出现一次))

Read more »

LeetCode_Remove Duplicates from Sorted List II

Posted on 2019-02-23 | In LeetCode

Remove Duplicates from Sorted List II

Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.
(移除链表中的重复元素(删除出现2次以上的元素))

Read more »

LeetCode_Search in Rotated Sorted Array II

Posted on 2019-02-23 | In LeetCode

Search in Rotated Sorted Array II

Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,0,1,2,2,5,6] might become [2,5,6,0,0,1,2]). You are given a target value to search. If found in the array return true, otherwise return false.
(在时间复杂度为O(log n)的前提下在经旋转的有序数组中检索(数组中含有重复元素))

Read more »

LeetCode_Remove Duplicates from Sorted Array II

Posted on 2019-02-23 | In LeetCode

Remove Duplicates from Sorted Array II

Given a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice and return the new length. Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.
(删除数组中超过两次的元素,in-place, 限制空间复杂度)

Read more »

LeetCode_Word Search

Posted on 2019-02-23 | Edited on 2019-06-05 | In LeetCode

Word Search

Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where “adjacent” cells are those horizontally or vertically neighboring. The same letter cell may not be used more than once.
(矩阵中进行词语搜索)

Read more »

LeetCode_Subsets

Posted on 2019-02-23 | In LeetCode

Subsets

Given a set of distinct integers, nums, return all possible subsets (the power set).
(列举所有子集)

Read more »

LeetCode_Combinations

Posted on 2019-02-23 | In LeetCode

Combinations

Given two integers n and k, return all possible combinations of k numbers out of 1 … n.
(列举 C_n^k 的所有组合)

Read more »

LeetCode_Minimum Window Substring

Posted on 2019-02-22 | Edited on 2019-02-23 | In LeetCode

Minimum Window Substring

Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).
(包含字符串的最小窗口)

Read more »

LeetCode_Sort Colors

Posted on 2019-02-21 | In LeetCode

Sort Colors

Given an array with n objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white and blue. Here, we will use the integers 0, 1, and 2 to represent the color red, white, and blue respectively.
(in-place 分组排序)

Read more »

LeetCode_Search A 2D Matrix

Posted on 2019-02-21 | In LeetCode

Search A 2D Matrix

Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted from left to right. The first integer of each row is greater than the last integer of the previous row.
(查找数值是否在有序矩阵中)

Read more »
1…121314…21

Sara Han

207 posts
4 categories
40 tags
© 2019 Sara Han
Powered by Hexo v3.8.0
|
Theme – NexT.Mist v6.4.2