上一页 1 ··· 57 58 59 60 61 62 63 64 65 ··· 79 下一页
摘要: package LeetCode_298 /** * 298. Binary Tree Longest Consecutive Sequence (Locked by leetcode) * https://www.lintcode.com/problem/binary-tree-longest-c 阅读全文
posted @ 2020-05-09 23:00 johnny_zhao 阅读(73) 评论(0) 推荐(0) 编辑
摘要: package LeetCode_655 /** * 655. Print Binary Tree * https://leetcode.com/problems/print-binary-tree/description/ * Example 1: Input: 1 / 2 Output: [[" 阅读全文
posted @ 2020-05-09 13:09 johnny_zhao 阅读(100) 评论(0) 推荐(0) 编辑
摘要: package LeetCode_208 /** * 208. Implement Trie (Prefix Tree) * https://leetcode.com/problems/implement-trie-prefix-tree/description/ * */ class Trie() 阅读全文
posted @ 2020-05-08 22:31 johnny_zhao 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 什么是TrieTree? Trie树,是一种非常重要的数据结构,又称字典树,查找单词树或者前缀树(Prefix Tree),是一种用于快速检索的多叉树结构,同时,它也是很多算法和复杂数据结构的基础,如后缀树,AC自动机等。 字典树(Tire)可以保存一些字符串->值的对应关系。基本上,跟Java的H 阅读全文
posted @ 2020-05-08 12:15 johnny_zhao 阅读(237) 评论(0) 推荐(0) 编辑
摘要: 我们先回顾一下,无论是栈还是队列,我们把元素进入的一端称作“尾部”,另一端称作“头部”。 对于栈,头部即是栈底,尾部即是栈顶。 对于队列,头部对应队首,尾部对应队尾。 单调栈 我们都已经非常熟悉栈了,它具有先入后出的性质。而单调栈为了满足单调的要求,增加了一下性质: 从栈顶到栈底的元素是严格递增 或 阅读全文
posted @ 2020-05-07 10:50 johnny_zhao 阅读(616) 评论(0) 推荐(0) 编辑
摘要: package LeetCode_507 /** * 507. Perfect Number * https://leetcode.com/problems/perfect-number/description/ * We define the Perfect Number is a positiv 阅读全文
posted @ 2020-05-07 00:33 johnny_zhao 阅读(101) 评论(0) 推荐(0) 编辑
摘要: package LeetCode_157 /** * 157. Read N Characters Given Read4 * Given a file and assume that you can only read the file using a given method read4, * 阅读全文
posted @ 2020-05-06 14:48 johnny_zhao 阅读(100) 评论(0) 推荐(0) 编辑
摘要: /** * 161. One Edit Distance * https://www.lintcode.com/problem/one-edit-distance/description * Given two strings S and T, determine if they are both 阅读全文
posted @ 2020-05-05 22:09 johnny_zhao 阅读(133) 评论(0) 推荐(0) 编辑
摘要: package LeetCode_72 /** * 72. Edit Distance * https://leetcode.com/problems/edit-distance/description/ * * Given two words word1 and word2, find the m 阅读全文
posted @ 2020-05-05 16:20 johnny_zhao 阅读(112) 评论(0) 推荐(0) 编辑
摘要: package LeetCode_1426 import java.util.* /** * 1426. Counting Elements * Given an integer array arr, count element x such that x + 1 is also in arr. * 阅读全文
posted @ 2020-05-04 12:16 johnny_zhao 阅读(172) 评论(0) 推荐(0) 编辑
上一页 1 ··· 57 58 59 60 61 62 63 64 65 ··· 79 下一页