摘要:
题目:reverse words in a string Given an input string, reverse the string word by word. For example,Given s = "the sky is blue",return "blue is sky the". 阅读全文
摘要:
题目: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not po 阅读全文
摘要:
问题描述: Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3,Return [1,3,3,1]. Note:Could you optimize your algorithm 阅读全文
摘要:
问题描述: Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return 问题分析: 第n行的数据是在第n-1行的基础上计算出来的。是一个迭代的过程 解决方法 阅读全文
摘要:
题目描述: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wik 阅读全文