上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 43 下一页

2015年10月4日

126. Word Ladder II( Queue; BFS)

摘要: Given two words (beginWord and endWord), and a dictionary's word list, find all shortest transformation sequence(s) from beginWord to endWord, such th 阅读全文

posted @ 2015-10-04 17:34 joannae 阅读(261) 评论(0) 推荐(0) 编辑

130. Surrounded Regions (Graph; DFS)

摘要: Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'.A region is captured by flipping all 'O's into 'X's in that surrounded ... 阅读全文

posted @ 2015-10-04 16:57 joannae 阅读(208) 评论(0) 推荐(0) 编辑

138. Copy List with Random Pointer (Graph, Map; DFS)

摘要: A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep copy ... 阅读全文

posted @ 2015-10-04 16:41 joannae 阅读(210) 评论(0) 推荐(0) 编辑

133. Clone Graph (Graph, Map; DFS)

摘要: Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. OJ's undirected graph serialization: Nodes are labeled 阅读全文

posted @ 2015-10-04 16:37 joannae 阅读(194) 评论(0) 推荐(0) 编辑

73. Set Matrix Zeroes (Array)

摘要: Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. Follow up: Did you use extra space? A straight forward s 阅读全文

posted @ 2015-10-04 16:21 joannae 阅读(177) 评论(0) 推荐(0) 编辑

79. Word Search (Array; DFS,Back-Track)

摘要: Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where "adjac 阅读全文

posted @ 2015-10-04 16:15 joannae 阅读(158) 评论(0) 推荐(0) 编辑

59. Spiral Matrix II (Array)

摘要: Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. For example, Given n = 3, You should return the follow 阅读全文

posted @ 2015-10-04 15:59 joannae 阅读(131) 评论(0) 推荐(0) 编辑

54. Spiral Matrix (Graph)

摘要: Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. For example,Given the following matrix:[ [ 1,... 阅读全文

posted @ 2015-10-04 15:56 joannae 阅读(185) 评论(0) 推荐(0) 编辑

74. Search a 2D Matrix (Graph; Divide-and-Conquer)

摘要: Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted f 阅读全文

posted @ 2015-10-04 15:51 joannae 阅读(158) 评论(0) 推荐(0) 编辑

48. Rotate Image (Array)

摘要: You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Follow up: Could you do this in-place? 阅读全文

posted @ 2015-10-04 15:46 joannae 阅读(123) 评论(0) 推荐(0) 编辑

上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 43 下一页

导航