上一页 1 ··· 67 68 69 70 71 72 73 74 75 ··· 79 下一页
摘要: quicksort是一个comparison-based的排序算法(heap sort,merge sort,插入都是) 阅读全文
posted @ 2019-09-30 12:12 johnny_zhao 阅读(230) 评论(0) 推荐(0) 编辑
摘要: import java.util.* import kotlin.collections.HashMap /** * 1161. Maximum Level Sum of a Binary Tree * https://leetcode.com/problems/maximum-level-sum-of-a-binary-tree/description/ * */ class Tree... 阅读全文
posted @ 2019-09-27 01:45 johnny_zhao 阅读(175) 评论(0) 推荐(0) 编辑
摘要: package LeetCode_3 import java.lang.StringBuilder /** * 3. Longest Substring Without Repeating Characters * https://leetcode.com/problems/longest-subs 阅读全文
posted @ 2019-09-19 01:41 johnny_zhao 阅读(98) 评论(0) 推荐(0) 编辑
摘要: /** * 905. Sort Array By Parity * https://leetcode.com/problems/sort-array-by-parity/description/ * * Given an array A of non-negative integers, return an array consisting of all the even elements of 阅读全文
posted @ 2019-09-08 00:11 johnny_zhao 阅读(96) 评论(0) 推荐(0) 编辑
摘要: /** 48. Rotate Image https://leetcode.com/problems/rotate-image/description/ */ class Solution { public void rotate(int[][] matrix) { //N x N matrix have floor(N/2) square cycers, for example 4x4 matr 阅读全文
posted @ 2019-09-07 23:51 johnny_zhao 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 在ubuntu系统下,更新android studio 3.5时,提示 jre/bin/java没写权限,发现解决方法如下: https://askubuntu.com/questions/1083125/android-studio-update-issue-with-jre-bin-java 阅读全文
posted @ 2019-09-04 14:28 johnny_zhao 阅读(532) 评论(0) 推荐(0) 编辑
摘要: /** * 700. Search in a Binary Search Tree * https://leetcode.com/problems/search-in-a-binary-search-tree/description/ * */ class TreeNode(var `val`: Int) { var left: TreeNode? = null var ... 阅读全文
posted @ 2019-08-29 22:34 johnny_zhao 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 958. Check Completeness of a Binary Tree //https://leetcode.com/problems/check-completeness-of-a-binary-tree/description/ class TreeNode(var `val`: Int) { var left: TreeNode? = null var right: TreeNod 阅读全文
posted @ 2019-08-29 14:08 johnny_zhao 阅读(102) 评论(0) 推荐(0) 编辑
摘要: class MinHeap constructor(maxSize_: Int) { var size = 0 var maxSize = maxSize_ var heapArray: Array? = null companion object { const val FRONT = 1 ... 阅读全文
posted @ 2019-08-04 00:37 johnny_zhao 阅读(242) 评论(0) 推荐(0) 编辑
摘要: /** * This problem was asked by Microsoft. Given an array of numbers and a number k, determine if there are three entries in the array which add up to the specified number k. For example, given [20... 阅读全文
posted @ 2019-07-28 12:38 johnny_zhao 阅读(217) 评论(0) 推荐(0) 编辑
上一页 1 ··· 67 68 69 70 71 72 73 74 75 ··· 79 下一页