随笔分类 -  Leetcode

上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 23 下一页
摘要:Serialization 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 阅读全文
posted @ 2018-11-23 20:45 Veritas_des_Liberty 阅读(303) 评论(0) 推荐(0) 编辑
摘要:Given 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 lowes 阅读全文
posted @ 2018-11-23 15:50 Veritas_des_Liberty 阅读(168) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL 阅读全文
posted @ 2018-11-22 22:40 Veritas_des_Liberty 阅读(246) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate each next pointer to point to its ne 阅读全文
posted @ 2018-11-22 22:28 Veritas_des_Liberty 阅读(262) 评论(0) 推荐(0) 编辑
摘要:Given preorder and inorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. For example, 阅读全文
posted @ 2018-11-22 19:08 Veritas_des_Liberty 阅读(173) 评论(0) 推荐(0) 编辑
摘要:Given inorder and postorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. For example, 阅读全文
posted @ 2018-11-22 18:04 Veritas_des_Liberty 阅读(191) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. N 阅读全文
posted @ 2018-11-21 22:09 Veritas_des_Liberty 阅读(198) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is symmet 阅读全文
posted @ 2018-11-21 18:33 Veritas_des_Liberty 阅读(185) 评论(0) 推荐(0) 编辑
摘要:"Top-down" Solution Here is the pseudocode for the recursion function maximum_depth(root, depth): 1. return if root is null 2. if root is a leaf node: 阅读全文
posted @ 2018-11-21 18:11 Veritas_des_Liberty 阅读(287) 评论(0) 推荐(0) 编辑
摘要:You have k lists of sorted integers in ascending order. Find the smallest range that includes at least one number from each of the k lists. We define 阅读全文
posted @ 2018-11-20 19:48 Veritas_des_Liberty 阅读(252) 评论(0) 推荐(0) 编辑
摘要:Given a list of directory info including directory path, and all the files with contents in this directory, you need to find out all the groups of dup 阅读全文
posted @ 2018-11-20 15:54 Veritas_des_Liberty 阅读(246) 评论(0) 推荐(0) 编辑
摘要:Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite restaurants represented by strings. You need to h 阅读全文
posted @ 2018-11-19 21:47 Veritas_des_Liberty 阅读(219) 评论(0) 推荐(0) 编辑
摘要:We define a harmonious array is an array where the difference between its maximum value and its minimum value is exactly1. Now, given an integer array 阅读全文
posted @ 2018-11-19 20:48 Veritas_des_Liberty 阅读(173) 评论(0) 推荐(0) 编辑
摘要:Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of th 阅读全文
posted @ 2018-11-19 18:19 Veritas_des_Liberty 阅读(193) 评论(0) 推荐(0) 编辑
摘要:There is a brick wall in front of you. The wall is rectangular and has several rows of bricks. The bricks have the same height but different width. Yo 阅读全文
posted @ 2018-11-19 18:00 Veritas_des_Liberty 阅读(192) 评论(0) 推荐(0) 编辑
摘要:TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/design-tinyurl and it returns a short URL such as http 阅读全文
posted @ 2018-11-19 12:16 Veritas_des_Liberty 阅读(282) 评论(0) 推荐(0) 编辑
摘要:Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. Example 1: Example 2: Note: The length of the giv 阅读全文
posted @ 2018-11-19 10:41 Veritas_des_Liberty 阅读(209) 评论(0) 推荐(0) 编辑
摘要:Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard like the image below. Examp 阅读全文
posted @ 2018-11-19 09:11 Veritas_des_Liberty 阅读(189) 评论(0) 推荐(0) 编辑
摘要:You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/ve 阅读全文
posted @ 2018-11-19 08:09 Veritas_des_Liberty 阅读(196) 评论(0) 推荐(0) 编辑
摘要:Given an array A of strings, find any smallest string that contains each string in A as a substring. We may assume that no string in A is substring of 阅读全文
posted @ 2018-11-18 21:48 Veritas_des_Liberty 阅读(275) 评论(0) 推荐(0) 编辑

上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 23 下一页