摘要: TCP协议三次握手 1. Client发送SYN报文; 2. Server发送SYN+ACK; 3. Client发送ACK 这样通过三次握手建立了连接,可以继续传输数据了 TCP四次挥手 1. Client发送FIN报文; 2. Server发送ACK报文; 3. Server发送FIN报文; 4 阅读全文
posted @ 2016-07-16 17:39 EvansYang 阅读(162) 评论(0) 推荐(0) 编辑
摘要: Reverse a singly linked list. 分别用迭代和递归实现 迭代实现: 递归实现: 1)如果head为空,或者只有head这一个节点,return head即可; 2)先遍历head->next为首的链表,得到一个头结点newHead; 3)把head赋值给head->next 阅读全文
posted @ 2016-04-29 16:13 EvansYang 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2016-04-28 15:30 EvansYang 阅读(102) 评论(0) 推荐(0) 编辑
摘要: block块 块对象(block Object) 是在Mac OS X10.6和iOS 4.0平台下可以使用的功能,它不是Object c而是C语言的功能的实现。Apple的文档中将其称为块对象或Block(复数为Blocks),在其他编程语言中,它与 闭包(closure) 功能基本相同。 块对象 阅读全文
posted @ 2016-03-09 15:02 EvansYang 阅读(251) 评论(0) 推荐(0) 编辑
摘要: Object c动态特性 动态绑定 实际的程序会使用各种各样的类的实例对象,所有的这些对象都可以用id类型来表示,因为id是通用的对象类型,可以用来存储任何类的对象。但是这样一来,程序中就会出现无法区分某个实例对象到底是哪个类的对象的情况。 Object c中的消息是在运行时才去绑定的。运行时系统首 阅读全文
posted @ 2016-03-09 14:36 EvansYang 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 类和对象 类 在Object c中类,其接口(interface)和实现(implementation)是分离开来的 类的声明 @interface 类名:父类名 { 实例变量的定义; } 方法声明; ... @end 类的实现 @implementation 类名 方法定义 ... @end 对象 阅读全文
posted @ 2016-03-06 22:02 EvansYang 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Object c基本语法 变量: 变量是只不过是一个名字到存储区域,让程序可以操纵。 Objective C中的每一个变量有特定的类型,确定该变量的存储器的大小和布局,可以存储在该存储器内的值的范围内;和设定操作,可变化应用。 常量: 常数是指为固定值该程序可能不会改变其执行过程中。这些固定的值也被 阅读全文
posted @ 2016-03-05 22:58 EvansYang 阅读(198) 评论(0) 推荐(0) 编辑
摘要: Related to question Excel Sheet Column Title Given a column title as appear in an Excel sheet, return its corresponding column number. For example: A 阅读全文
posted @ 2016-03-05 11:09 EvansYang 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Given two strings s and t, write a function to determine if t is an anagram of s. For example,s = "anagram", t = "nagaram", return true.s = "rat", t = 阅读全文
posted @ 2016-03-04 09:43 EvansYang 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below 阅读全文
posted @ 2016-03-04 09:16 EvansYang 阅读(193) 评论(0) 推荐(0) 编辑