上一页 1 ··· 5 6 7 8 9 10 11 下一页

LeetCode 876 Middle of the Linked List 解题报告

摘要: 题目要求 Given a non-empty, singly linked list with head node head, return a middle node of linked list. If there are two middle nodes, return the second 阅读全文
posted @ 2019-02-11 10:01 锋上磬音 阅读(141) 评论(0) 推荐(0) 编辑

LeetCode 589 N-ary Tree Preorder Traversal 解题报告

摘要: 题目要求 Given an n-ary tree, return the preorder traversal of its nodes' values. 题目分析及思路 题目给出一棵N叉树,要求返回结点值的前序遍历。可以使用递归的方法做。因为是前序遍历,所以最开始就加入根结点的值。 python代 阅读全文
posted @ 2019-02-10 09:12 锋上磬音 阅读(104) 评论(0) 推荐(0) 编辑

LeetCode 922 Sort Array By Parity II 解题报告

摘要: 题目要求 Given an array A of non-negative integers, half of the integers in A are odd, and half of the integers are even. Sort the array so that whenever  阅读全文
posted @ 2019-02-09 09:17 锋上磬音 阅读(101) 评论(0) 推荐(0) 编辑

LeetCode 985 Sum of Even Numbers After Queries 解题报告

摘要: 题目要求 We have an array A of integers, and an array queries of queries. For the i-th query val = queries[i][0], index = queries[i][1], we add val to A[i 阅读全文
posted @ 2019-02-08 15:25 锋上磬音 阅读(94) 评论(0) 推荐(0) 编辑

LeetCode 811 Subdomain Visit Count 解题报告

摘要: 题目要求 A website domain like "discuss.leetcode.com" consists of various subdomains. At the top level, we have "com", at the next level, we have "leetcod 阅读全文
posted @ 2019-02-07 22:18 锋上磬音 阅读(273) 评论(0) 推荐(0) 编辑

LeetCode 867 Transpose Matrix 解题报告

摘要: 题目要求 Given a matrix A, return the transpose of A. The transpose of a matrix is the matrix flipped over it's main diagonal, switching the row and colum 阅读全文
posted @ 2019-02-05 09:22 锋上磬音 阅读(156) 评论(0) 推荐(0) 编辑

LeetCode 559 Maximum Depth of N-ary Tree 解题报告

摘要: 题目要求 Given a n-ary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthe 阅读全文
posted @ 2019-02-04 10:33 锋上磬音 阅读(114) 评论(0) 推荐(0) 编辑

LeetCode 883 Projection Area of 3D Shapes 解题报告

摘要: 题目要求 On a N * N grid, we place some 1 * 1 * 1 cubes that are axis-aligned with the x, y, and z axes. Each value v = grid[i][j] represents a tower of v 阅读全文
posted @ 2019-02-02 09:50 锋上磬音 阅读(162) 评论(0) 推荐(0) 编辑

LeetCode 590 N-ary Tree Postorder Traversal 解题报告

摘要: 题目要求 Given an n-ary tree, return the postorder traversal of its nodes' values. 题目分析及思路 题目给出一棵N叉树,要求返回结点值的后序遍历。可以使用递归的方法做。因为是后序遍历,所以最后加入根结点的值。 python代码 阅读全文
posted @ 2019-02-01 16:01 锋上磬音 阅读(99) 评论(0) 推荐(0) 编辑

LeetCode 700 Search in a Binary Search Tree 解题报告

摘要: 题目要求 Given the root node of a binary search tree (BST) and a value. You need to find the node in the BST that the node's value equals the given value. 阅读全文
posted @ 2019-01-31 11:38 锋上磬音 阅读(151) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 下一页