摘要:
There are n coins in a line. Two players take turns to take one or two coins from right side until there are no more coins left. The player who take t 阅读全文
摘要:
Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. 思路: 分为两步 1. BFS,新建所有图中的node,用一个HashMap建立原来node和新的node之 阅读全文
摘要:
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and 阅读全文
摘要:
Design an algorithm and write code to serialize and deserialize a binary tree. Writing the tree to a file is called 'serialization' and reading back f 阅读全文
摘要:
Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. Given the below binary tree: return 6. 一个二叉树的最大量 阅读全文