摘要:
Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked list is 1 -> 2 -> 3 ->... 阅读全文
摘要:
Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as00000010100101000001111010011100), return ... 阅读全文
摘要:
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.According to thedefinition of LCA on Wikipedia: “The lowest ... 阅读全文
摘要:
Write a SQL query to get the second highest salary from theEmployeetable.+----+--------+| Id | Salary |+----+--------+| 1 | 100 || 2 | 200 || ... 阅读全文
摘要:
Given a collection of integers that might contain duplicates,nums, return all possible subsets.Note:Elements in a subset must be in non-descending ord... 阅读全文
摘要:
Given a set of distinct integers,nums, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not... 阅读全文
摘要:
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to thedefinition of LCA on Wikipedia: ... 阅读全文
摘要:
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(n)空间:存成数组后比较 class Solution: # @ 阅读全文
摘要:
Given an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.A number multiplied by10will ... 阅读全文
摘要:
Given a column title as appear in an Excel sheet, return its corresponding column number.For example: A -> 1 B -> 2 C -> 3 ... Z -> 26 AA -> 27 ... 阅读全文