- 博客(42)
- 收藏
- 关注
原创 android linearlayout weight工作原理
阿里线下一面中,面试官问我,view的渲染过程,回答不会,然后他就问了linearlayout中 weight的工作原理weight实际上并不能理解为权重。要把其理解为权重,则要把对应的height/width=“0dp”设,linearlayout.orientation=horizonal;linearlayout.childview[i].weight=ki;li
2015-04-29 19:00:58
575
原创 自己理解的智能指针
看安卓内核,第一章就碰到智能指针了。看了网上的一些文章,自己实践了一下。自己的体会:普通指针直接为某个具体类型分配空间,对该空间的管理直接由指针来操作。T* p=new T(t);智能指针相当于对该空间进行封装。智能指针实际是一个类,shared_ptr sp(new T(t));类里面包含一个成员,uptr(T* t,size_t use)。uptr除了保存着普
2015-04-11 10:41:26
613
原创 网易笔试题 推箱子
时间限制:10000ms单点时限:1000ms内存限制:256MB描述推箱子是一款经典游戏。如图所示,灰色格子代表不能通过区域,蓝色方格是箱子,黑色圆形代表玩家,含有圆点的格子代表目标点。push.png规定以下规则:1、一局游戏中只会有一个箱子,一个玩家和一个目标点。2、通过方向键控制玩家移动。3、图中的灰色格子代表墙壁,玩家与箱子都不能通过。4、推到墙壁的箱子,就无法再将箱子推离墙壁,因为玩家
2015-04-08 22:22:12
744
1
原创 链表相关
腾讯一面的算法题是链表的排序。没回答上来,所以重新看了链表相关的知识和题目。在数据结构中,链表包含这头指针。链表实际的数值是头指针的下一个指针。正是因为存在着头指针,所以对链表第一个元素的操作显得比较简单。而在leetcode 中,用Java刷linklist的相关问题,都没有头指针。在解题的时候在每个链表前面自己创建一个头指针能够给解题带来很大的简化。对于归并排序的链表。我一开始的思维是:链表a
2015-03-19 20:55:00
417
原创 腾讯一面连
0.自我介绍。1 .双向链表排序,2.数据库,防止重复插入数据。没答出来,3.三次握手和四次挥手。4.进程调度。5.uml跟nosql 就说了自己不了解。6.导师项目,简单说了下。
2015-03-17 15:44:44
485
原创 阿里三面 失败告终
早上九点多接到杭州的电话,阿里三面来了。首先还是介绍下Citygo,大概了解了一下项目的背景。失败地方之一,我介绍这个比赛的背景废话太多,什么清华北大之类的,不应该说这些,而应该突出自己短时间高质量完成。问了如何存储游记,目前仍然是直接存储,没什么特别的地方。问了在数据量大的时候如何判断周围有哪些游记,回答按照行政区来划分,(在西安,按照行政区来划分还是可行的,面试官说对杭
2015-03-16 15:53:48
4394
原创 阿里一面和二面
目前看来应该是很侥幸地过了阿里实习生内推一二面。可能还是更加看重我的腾讯创新大赛的获奖这个名头,导致我二面的那么糟糕的回答都过了。一面是一个很nice的面试官,计算机院学长,问题都是点到为止,没有深入追寻,首先询问了项目,然后简单问了熟悉哪些排序,稳定,之类的。简单问了面向对象的知识,简单问了我黑客的经历还问了数据库的知识,union的理论是什么,答案是交集并集笛卡
2015-03-11 22:57:06
4289
1
原创 阿里内推 微博运营
阿里内推,从春节前到现在估计半个多月过去了吧.比我晚申请的都接到面试电话了.就我没有.一直不相信自己的简历都会不过关.在看了好多遍建立后,发现里面有一句话,"代码虽然很烂,但是能用并且获奖"哈哈,自己都吓到了...面试官看到这句话把握pass情理之中吧...赶紧修改了,不知道能不能亡羊补牢.并且又往蚂蚁金服那边投了一下.昨天在微博上看到有个转发关注送肾六的.
2015-03-04 22:22:51
514
原创 Longest Valid Parentheses
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the longest valid parentheses substring is "()", which
2015-03-03 21:10:05
378
原创 Interleaving String
Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 = "aabcc",s2 = "dbbca",When s3 = "aadbbcbcac", return true.When s3 = "aadbbbaccc", return fals
2015-03-02 20:04:15
288
原创 Decode Ways
package leetcode;public class test {/* * A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message co
2015-02-16 22:40:14
328
原创 zhemeshuang.com
昨天脑袋发热买了这个域名这么爽。总的来说,最近生活稍显拮据,但是又找不到赚钱的渠道。同时,实验室无所事事,有限元那边没有兴趣,担心这一年后工作的事情。不知道该怎么办??高人求指点。。暂时这样。
2014-12-03 12:53:20
427
原创 Copy List with Random Pointer
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep copy of the list.这道问题是深层拷贝的问题。所谓的深层拷贝和浅层拷贝在于指针引用内
2014-11-25 19:53:04
359
原创 Container With Most Water
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two
2014-11-19 12:05:30
342
原创 Combination Sum II
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.Each number in C may only be used once in the combination
2014-11-05 18:18:46
373
原创 Combination Sum
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeated number may be chosen from C unlimited number o
2014-11-05 17:10:46
365
原创 Climbing Stairs
You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?z这是一道简单题,类似于
2014-11-05 11:12:37
400
原创 Best Time to Buy and Sell Stock III
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 at most two transactions.Note:You may not e
2014-11-05 10:33:46
325
原创 Best Time to Buy and Sell Stock
Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), d
2014-11-04 15:54:35
302
原创 Anagrams
Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.
2014-11-03 19:25:48
350
原创 Add Binary
Given two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "100"z这是一道
2014-11-03 12:12:04
428
原创 Permutations II
Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2] have the following unique permutations:[1,1,2], [1,2,1], and [2,1,1].z
2014-11-03 11:39:54
410
原创 Permutations
Given a collection of numbers, return all possible permutations.For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2,1].一遍通过!用的是递归的
2014-11-03 11:13:34
531
原创 Permutation Sequence
The set [1,2,3,…,n] contains a total of n! unique permutations.By listing and labeling all of the permutations in order,We get the following sequence (ie, for n = 3):"123""132""213""231""312"
2014-10-31 16:42:28
352
原创 candy
There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requirements:Each child must have at least one ca
2014-10-30 16:19:12
293
原创 4Sum
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.Note:Elements in a qu
2014-10-29 19:15:10
302
原创 three sum closest
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exactly
2014-10-29 16:42:07
337
原创 3sum
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:Elements in a triplet (a,b,c) must be
2014-10-29 16:29:33
297
原创 Remove Duplicates from Sorted List II
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.For example,Given 1->2->3->3->4->4->5, return 1->2->5.Given 1->1->1->
2014-10-29 10:14:24
330
原创 Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, return 1->2->3.这是第一道完全在web中写并且提交并且
2014-10-28 17:26:53
301
原创 Remove Duplicates from Sorted Array II
Follow up for "Remove Duplicates":What if duplicates are allowed at most twice?For example,Given sorted array A = [1,1,1,2,2,3],Your function should return length = 5, and A is now [1,1,2,2,3]这一
2014-10-28 16:59:06
288
原创 Remove Duplicates from Sorted Array
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in place with c
2014-10-28 16:16:13
293
原创 Add Two Numbers
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link
2014-10-27 22:21:38
296
原创 Merge Intervals
import java.util.ArrayList;import java.util.List;import javax.swing.text.StyledEditorKit.ForegroundAction;public class Merge_Intervals { /** * Given a collection of intervals, merge all overl
2014-10-17 17:43:57
388
原创 Jump Game II
Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Your goal is to
2014-10-17 15:16:49
340
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人