摘要: Clone an undirected graph. Each node in the graph contains alabeland a list of itsneighbors.OJ's undirected graph serialization:Nodes are labeled uniq... 阅读全文
posted @ 2014-07-06 13:29 Hicandyman 阅读(122) 评论(0) 推荐(0)
摘要: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ... 阅读全文
posted @ 2014-07-06 12:23 Hicandyman 阅读(391) 评论(0) 推荐(0)
摘要: 二叉树前序遍历,中序遍历,后序遍历。 1 void preOrder_N(BTNode* root) 2 { 3 stack s; 4 while(root!=NULL||!s.empty()) 5 { 6 if(root!=NULL) 7 {... 阅读全文
posted @ 2014-07-06 09:39 Hicandyman 阅读(147) 评论(0) 推荐(0)
摘要: Given an array withnobjects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, wh... 阅读全文
posted @ 2014-07-06 05:48 Hicandyman 阅读(241) 评论(0) 推荐(0)
摘要: There areNgas stations along a circular route, where the amount of gas at stationiisgas[i].You have a car with an unlimited gas tank and it costscost[... 阅读全文
posted @ 2014-07-06 04:51 Hicandyman 阅读(125) 评论(0) 推荐(0)