摘要: 原文出处:http://www.cnblogs.com/top5/archive/2012/05/04/2482328.html在实际开发中LayoutInflater这个类还是非常有用的,它的作用类似于findViewById()。不同点是LayoutInflater是用来找res/layout/... 阅读全文
posted @ 2015-07-30 10:35 scottwang 阅读(443) 评论(0) 推荐(0) 编辑
摘要: 原文链接:http://kenby.iteye.com/blog/1149001struct sockaddr和struct sockaddr_in这两个结构体用来处理网络通信的地址。在各种系统调用或者函数中,只要和网络地址打交道,就得用到这两个结构体。网络中的地址包含3个方面的属性:1 地址类型:... 阅读全文
posted @ 2015-07-15 21:25 scottwang 阅读(15028) 评论(1) 推荐(5) 编辑
摘要: 题目描述:You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a ... 阅读全文
posted @ 2015-05-16 16:06 scottwang 阅读(1250) 评论(0) 推荐(1) 编辑
摘要: 题目描述:Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.解题思路:把除数表示为:dividend = 2^i * diviso... 阅读全文
posted @ 2015-05-16 11:49 scottwang 阅读(455) 评论(0) 推荐(0) 编辑
摘要: 题目描述:Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Update (2014-11-02):... 阅读全文
posted @ 2015-05-16 10:22 scottwang 阅读(322) 评论(0) 推荐(0) 编辑
摘要: 题目描述:Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn'... 阅读全文
posted @ 2015-05-15 20:38 scottwang 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 题目描述: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 spac... 阅读全文
posted @ 2015-05-15 20:29 scottwang 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 题目描述:Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.If the number of nodes is not a multiple of k th... 阅读全文
posted @ 2015-05-15 20:04 scottwang 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 题目描述:Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.解题思路:分治方法。将K个List不断地分解为前半部分和后半部分。分别进行两个List的合并。... 阅读全文
posted @ 2015-05-14 17:54 scottwang 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 题目描述:Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set i... 阅读全文
posted @ 2015-05-14 17:14 scottwang 阅读(170) 评论(0) 推荐(0) 编辑