自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

fighting!

空白

  • 博客(671)
  • 收藏
  • 关注

原创 做了的事和计划做的一些事

书籍:<机器学习实战> 已看完,GitHub代码已完成(书中代码是python2,我的是python3)。强烈推荐此书 链接:https://github.com/hyc2017/MachineLearningInAction<集体智慧编程> 已看完。GitHub代码已完成(书中代码是python2,我的是python3)。强烈推荐此书 链接:https:/...

2018-01-29 14:18:00 1276 33

原创 辞职考研上岸北大软微

我从18年辞职考研。第一年考浙大计科361分,因一心想去计科,放弃工程师学院和软件学院的调剂面试。第二年考浙大计科402分,面试被刷。第三年考北大软微397分,成功上岸。之后有时间会补充下细节。...

2022-04-07 16:34:30 287

原创 778-Swim in Rising Water

DescriptionOn an N x N grid, each square grid[i][j] represents the elevation at that point (i,j).Now rain starts to fall. At time t, the depth of the water everywhere is t. You can swim from a squ...

2018-06-06 21:46:17 578 1

原创 130-Surrounded Regions

DescriptionGiven a 2D board containing ‘X’ and ‘O’ (the letter O), capture all regions surrounded by ‘X’.A region is captured by flipping all ‘O’s into ‘X’s in that surrounded region.Example:...

2018-06-05 21:30:50 391

原创 133-Clone Graph

DescriptionClone 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 uniquely.We use # as a separator...

2018-06-05 17:48:14 328

原创 332-Reconstruct Itinerary

DescriptionGiven a list of airline tickets represented by pairs of departure and arrival airports [from, to], reconstruct the itinerary in order. All of the tickets belong to a man who departs from ...

2018-05-31 15:56:46 405

原创 210-Course Schedule II

DescriptionThere are a total of n courses you have to take, labeled from 0 to n-1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expres...

2018-05-31 14:54:46 405

原创 542-01 Matrix

DescriptionGiven a matrix consists of 0 and 1, find the distance of the nearest 0 for each cell.The distance between two adjacent cells is 1.Example 1: Input:0 0 00 1 00 0 0Output:...

2018-05-30 16:03:58 383

原创 721-Accounts Merge

DescriptionGiven a list accounts, each element accounts[i] is a list of strings, where the first element accounts[i][0] is a name, and the rest of the elements are emails representing emails of the ...

2018-05-30 14:56:57 393

原创 417-Pacific Atlantic Water Flow

DescriptionGiven an m x n matrix of non-negative integers representing the height of each unit cell in a continent, the “Pacific ocean” touches the left and top edges of the matrix and the “Atlantic...

2018-05-30 13:35:09 306

原创 473-Matchsticks to Square

DescriptionRemember the story of Little Match Girl? By now, you know exactly what matchsticks the little match girl has, please find out a way you can make one square by using up all those matchstic...

2018-05-28 23:14:04 301

原创 200-Number of Islands

DescriptionGiven a 2d grid map of ‘1’s (land) and ‘0’s (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. Y...

2018-05-28 22:55:00 245

原创 802-Find Eventual Safe States

DescriptionIn a directed graph, we start at some node and every turn, walk along a directed edge of the graph. If we reach a node that is terminal (that is, it has no outgoing directed edges), we s...

2018-05-28 22:49:27 342

原创 785-Is Graph Bipartite?

DescriptionGiven an undirected graph, return true if and only if it is bipartite.Recall that a graph is bipartite if we can split it’s set of nodes into two independent subsets A and B such that e...

2018-05-28 22:19:47 413

原创 491-Increasing Subsequences

DescriptionGiven an integer array, your task is to find all the different possible increasing subsequences of the given array, and the length of an increasing subsequence should be at least 2 .E...

2018-05-28 21:55:25 252

原创 547-Friend Circles

DescriptionThere are N students in a class. Some of them are friends, while some are not. Their friendship is transitive in nature. For example, if A is a direct friend of B, and B is a direct frien...

2018-05-28 17:47:06 236

原创 529-Minesweeper

DescriptionLet’s play the minesweeper game (Wikipedia, online game)!You are given a 2D char matrix representing the game board. ‘M’ represents an unrevealed mine, ‘E’ represents an unrevealed empt...

2018-05-28 17:01:56 348

原创 733-Flood Fill

DescriptionAn image is represented by a 2-D array of integers, each integer representing the pixel value of the image (from 0 to 65535).Given a coordinate (sr, sc) representing the starting pixel ...

2018-05-28 16:09:44 346

原创 145-Binary Tree Postorder Traversal

DescriptionGiven a binary tree, return the postorder traversal of its nodes’ values.Example:Input: [1,null,2,3] 1 \ 2 / 3Output: [3,2,1]Follow up: Recursive solution is ...

2018-05-28 15:57:06 217

原创 98-Validate Binary Search Tree

DescriptionGiven a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only nodes with keys less than the nod...

2018-05-25 14:59:26 261

原创 236-Lowest Common Ancestor of a Binary Tree

DescriptionGiven a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between...

2018-05-25 14:45:47 262

原创 117-Populating Next Right Pointers in Each Node II

DescriptionGiven a binary treestruct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next;}Populate each next pointer to point to its next right node. If there is ...

2018-05-25 14:18:27 250

原创 113-Path Sum II

DescriptionGiven a binary tree and a sum, find all root-to-leaf paths where each path’s sum equals the given sum.Note: A leaf is a node with no children.Example:Given the below binary tree a...

2018-05-25 13:51:08 165

原创 116-Populating Next Right Pointers in Each Node

DescriptionGiven a binary treestruct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next;}Populate each next pointer to point to its next right node. If there is ...

2018-05-25 11:25:54 145

原创 114-Flatten Binary Tree to Linked List

DescriptionGiven a binary tree, flatten it to a linked list in-place.For example, given the following tree: 1 / \ 2 5 / \ \3 4 6The flattened tree should look like:1 \...

2018-05-25 11:10:14 187

原创 652-Find Duplicate Subtrees

DescriptionGiven a binary tree, return all duplicate subtrees. For each kind of duplicate subtrees, you only need to return the root node of any one of them.Two trees are duplicate if they have th...

2018-05-25 10:45:06 187

原创 450-Delete Node in a BST

DescriptionGiven a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference (possibly updated) of the BST.Basically, the deletion can b...

2018-05-25 10:28:03 160

原创 129-Sum Root to Leaf Numbers

DescriptionGiven a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1->2->3 which represents the number 123....

2018-05-25 10:06:52 188

原创 662-Maximum Width of Binary Tree

DescriptionGiven a binary tree, write a function to get the maximum width of the given tree. The width of a tree is the maximum width among all levels. The binary tree has the same structure as a fu...

2018-05-25 09:47:43 269

原创 199-Binary Tree Right Side View

DescriptionGiven a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.Example:Input: [1,2,3,null,5,null,4]...

2018-05-06 19:41:46 199

原创 102-Binary Tree Level Order Traversal

DescriptionGiven a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level).For example:Given binary tree [3,9,20,null,null,15,7], 3...

2018-05-06 19:35:18 174

原创 449-Serialize and Deserialize BST

DescriptionSerialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connecti...

2018-05-06 19:29:26 245

原创 684-Redundant Connection

DescriptionIn this problem, a tree is an undirected graph that is connected and has no cycles.The given input is a graph that started as a tree with N nodes (with distinct values 1, 2, …, N), with...

2018-05-06 19:00:03 280

原创 337-House Robber III

DescriptionThe thief has found himself a new place for his thievery again. There is only one entrance to this area, called the “root.” Besides the root, each house has one and only one parent house....

2018-05-06 18:35:52 284

原创 623-Add One Row to Tree

DescriptionGiven the root of a binary tree, then value v and depth d, you need to add a row of nodes with value v at the given depth d. The root node is at depth 1.The adding rule is: given a posi...

2018-05-03 20:16:31 147

原创 655-Print Binary Tree

DescriptionPrint a binary tree in an m*n 2D string array following these rules:The row number m should be equal to the height of the given binary tree.The column number n should always be an odd...

2018-05-03 20:08:58 289

原创 508-Most Frequent Subtree Sum

DescriptionGiven the root of a tree, you are asked to find the most frequent subtree sum. The subtree sum of a node is defined as the sum of all the node values formed by the subtree rooted at that ...

2018-05-03 20:00:29 159

原创 515-Find Largest Value in Each Tree Row

DescriptionYou need to find the largest value in each row of a binary tree.Example:Input: 1 / \ 3 2 / \ \ 5 3 9 Output: [1, 3, 9]问题描...

2018-05-03 19:49:38 224

原创 513-Find Bottom Left Tree Value

DescriptionGiven a binary tree, find the leftmost value in the last row of the tree.Example 1:Input: 2 / \ 1 3Output:1Example 2: Input: 1 / \ 2 ...

2018-05-03 19:46:18 210

原创 654-Maximum Binary Tree

DescriptionGiven an integer array with no duplicates. A maximum tree building on this array is defined as follow:The root is the maximum number in the array.The left subtree is the maximum tree ...

2018-05-03 19:41:38 143

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除