随笔分类 - LeetCode
摘要:Problem Definition: Given a sorted integer array without duplicates, return the summary of its ranges. For example, given [0,1,2,4,5,7], return ["0-...
阅读全文
摘要:Problem Definition: Given an integer, write a function to determine if it is a power of two.Solution:class Solution: # @param {integer} n # @re...
阅读全文
摘要:Problem Definition: Given a singly linked list, determine if it is a palindrome. Follow up: Could you do it in O(n) time and O(1) space?思路:为了达到O(1)...
阅读全文
摘要:Problem Definition: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definiti...
阅读全文
摘要:Problem Definition: Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Supposed the linked...
阅读全文

浙公网安备 33010602011771号