摘要:
Question:Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which ... 阅读全文
摘要:
Question:Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the n... 阅读全文
摘要:
Question:Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the giv... 阅读全文
摘要:
Question:GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1... 阅读全文
摘要:
Question:Given an indexk, return thekthrow of the Pascal's triangle. For example, givenk= 3, Return[1,3,3,1].1、题型分类:2、思路:直接使用公式,第n行 第0个数是1,从第i个数开始一次... 阅读全文
摘要:
Question:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a ca... 阅读全文
摘要:
Question:Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -... 阅读全文