2013年10月18日

Clone Graph

摘要: Clone an undirected graph. Each node in the graph contains alabeland a list of itsneighbors.OJ's undirected graph serialization:Nodes are labeled uniquely.We use#as a separator for each node, and,as a separator for node label and each neighbor of the node.As an example, consider the serialized g 阅读全文

posted @ 2013-10-18 07:57 Step-BY-Step 阅读(170) 评论(0) 推荐(0) 编辑

Gas Station

摘要: 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[i]of gas to travel from stationito its next station (i+1). You begin the journey with an empty tank at one of the gas stations.Return the starting gas 阅读全文

posted @ 2013-10-18 07:20 Step-BY-Step 阅读(216) 评论(0) 推荐(0) 编辑

导航