自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(29)
  • 收藏
  • 关注

原创 导师招生 香港城市大学计算机博士项目

2019 PhD Student Openings in Applied Machine Learning and Bioinformatics at CityU(HK)(http://bioinfo.cs.cityu.edu.hk/)Each Fellowship recipient will receive financial award in the amount of USD169...

2018-10-10 18:30:51 2515 2

原创 2019 PhD Student Openings in Applied Machine Learning and Bioinformatics at CityU(HK)

2019 PhD Student Openings in Applied Machine Learning and Bioinformatics at CityU(HK)(http://bioinfo.cs.cityu.edu.hk/)Each Fellowship recipient will receive financial award in the amount of USD169...

2018-09-04 21:37:01 422

原创 【LeetCode】377. Combination Sum IV

Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target.Example:nums = [1, 2, 3]target = 4The pos

2016-08-06 10:25:59 261

原创 【LeetCode】108. Convert Sorted Array to Binary Search Tree

Given an array where elements are sorted in ascending order, convert it to a height balanced BST.class Solution {public: TreeNode* build(vector& nums, int left, int right) { if (left >

2016-08-01 16:45:01 230

原创 【LeetCode】337. House Robber III

The 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. After a tour

2016-07-21 19:38:39 261

原创 【LeetCode】230. Kth Smallest Element in a BST

Given a binary search tree, write a function kthSmallest to find the kth smallest element in it.Note: You may assume k is always valid, 1 ≤ k ≤ BST's total elements.Follow up:What if the

2016-07-21 10:04:47 238

原创 【LeetCode】12. Integer to Roman

Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.Subscribe to see which companies asked this questionclass Solution {public:

2016-07-18 23:36:16 192

原创 【LeetCode】318. Maximum Product of Word Lengths

Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. You may assume that each word will contain only lower case le

2016-07-18 15:41:31 227

转载 android插入耳机状态使用扬声器外放音乐

原文地址插入耳机的时候也可以选择使用扬声器播放音乐,来电铃声就是这么用的。但是只能用MediaPlayer,播放音频文件。使用AudioTrack.write播放是行不通的。按理说AudioRecord、AudioTrack类相对于MediaRecorder mediaPlayer来说,更加接近底层,应该也行得通的。还搞不清楚为什么,大家来解答一下!插入

2016-06-27 16:53:42 3891 1

转载 童趣

童趣  余忆童稚时,能张目对日,明察秋毫,见藐小之物必细察其纹理,故时有物外之趣。  夏蚊成雷,私拟作群鹤舞于空中,心之所向,则或千或百,果然鹤也;昂首观之,项为之强。又留蚊于素帐中,徐喷以烟,使之冲烟而飞鸣,作青云白鹤观,果如鹤唳云端,为之怡然称快。  余常于土墙凹凸处,花台小草丛杂处,蹲其身,使与台齐;定神细视,以丛草为林,以虫蚁为兽,以土砾凸者为丘

2016-06-27 16:47:05 227

原创 【LeetCode】94. Binary Tree Inorder Traversal

Given a binary tree, return the inorder traversal of its nodes' values.For example:Given binary tree [1,null,2,3], 1 \ 2 / 3return [1,3,2].Note: Recursive solu

2016-06-20 16:00:45 181

原创 【LeetCode】343. Integer Break

Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum product you can get.For example, given n = 2, ret

2016-06-20 15:12:29 274

原创 【LeetCode】319. Bulb Switcher

There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bulb. On the third round, you toggle every third bulb (turning on if it's off or turning off

2016-06-19 16:19:57 201

原创 【LeetCode】357. Count Numbers with Unique Digits

Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x n.Example:Given n = 2, return 91. (The answer should be the total numbers in the range of 0 ≤ x [11,22,33,44,

2016-06-18 20:10:31 239

原创 【LeetCode】347. Top K Frequent Elements

Given a non-empty array of integers, return the k most frequent elements.For example,Given [1,1,1,2,2,3] and k = 2, return [1,2].Note: You may assume k is always valid, 1 ≤ k ≤ number

2016-06-15 22:25:31 206

原创 【LeetCode】122. Best Time to Buy and Sell Stock II

Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy on

2016-06-14 20:44:54 200

原创 【LeetCode】260. Single Number III

Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once.For example:Given

2016-06-14 11:39:38 220

原创 【LeetCode】268. Missing Number

Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.For example,Given nums = [0, 1, 3] return 2.Note:Your algorithm sho

2016-05-31 16:20:45 220

原创 【LeetCode】96. Unique Binary Search Trees

Given n, how many structurally unique BST's (binary search trees) that store values 1...n?For example,Given n = 3, there are a total of 5 unique BST's. 1 3 3 2 1 \

2016-05-30 15:33:02 179

原创 【LeetCode】238. Product of Array Except Self

Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].Solve it without division and in O

2016-05-30 11:51:09 267

原创 【LeetCode】338. Counting Bits

Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and return them as an array.Example:For num = 5

2016-05-27 10:26:06 184

翻译 【Quora】如何在2000个数中快速地找到最大的3个呢?

Quora:原帖在此这里我们就以2000名选手,,找出最好的3个为例吧(并不是单纯的冠亚季军哦)首先我们参考一下淘汰赛模式。| 在淘汰赛模式下,在n名选手参赛的情况下我们可以通过n-1次比赛知道本次比赛的冠军。详情见下图好了,其实在进行完本次淘汰赛以后想找出前几名选手只需要做一点小小的工作就可以。我们先来找第二

2016-02-02 16:33:24 391

原创 【LeetCode】144. Binary Tree Preorder Traversal

Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,2,3].Note: Recursive solution i

2016-02-02 10:17:35 279

原创 【LeetCode】169. Majority Element

Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the majority element

2016-01-31 11:36:40 245

原创 【LeetCode】137. Single Number II

137. Single Number IIGiven an array of integers, every element appears three times except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could y

2016-01-23 14:18:08 315

原创 【LeetCode】136. Single Number

Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without using ext

2016-01-18 17:51:39 263

原创 【二叉树】关于二叉树的后续遍历遍历以及栈

我们知道,二叉树的遍历当中,后序非递归的遍历i是一个非常guanjian

2015-11-03 22:29:56 1466

原创 【二叉树】线索化二叉树豆知识

首先,我们要明白什么是线索化二叉树?线索化二叉树:是利用二叉树的链式存储结构中存在的空指针,利用这些空指针指向二叉树遍历序列的前驱或后继元素,以便于加快遍历和查找结点的速度。那么接下来~我们就要总结一下关于线索化二叉树的豆知识啦Q1:在线索化二叉树当中,能够利用的指针有多少个呢? A1:首先,我们将Nn表示一颗二叉树中度为n的结点一共有N个。总结点数

2015-09-12 21:59:53 443

原创 【栈的应用】栈的出栈序列问题研究

在平日的关于栈学习当中,我们会经常遇到关于栈的出栈序列的问题。虽然这些问题很多可以通过穷举法实现解决。但是遇到了考试或者面试的时候,往往穷举法会花费大量的时间。于是寻找类似问题的规律往往是更高效的解决办法。在首先,我们先判断出栈的元素的顺序是否合法一、出栈序列的合法化问题:例题1:若元素进栈的 顺序为1-2-3-4,能否得到出栈序列为3-1-

2015-07-11 21:28:40 570

空空如也

空空如也

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

TA关注的人

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