03 2016 档案

摘要:block块 块对象(block Object) 是在Mac OS X10.6和iOS 4.0平台下可以使用的功能,它不是Object c而是C语言的功能的实现。Apple的文档中将其称为块对象或Block(复数为Blocks),在其他编程语言中,它与 闭包(closure) 功能基本相同。 块对象 阅读全文
posted @ 2016-03-09 15:02 EvansYang 阅读(273) 评论(0) 推荐(0)
摘要:Object c动态特性 动态绑定 实际的程序会使用各种各样的类的实例对象,所有的这些对象都可以用id类型来表示,因为id是通用的对象类型,可以用来存储任何类的对象。但是这样一来,程序中就会出现无法区分某个实例对象到底是哪个类的对象的情况。 Object c中的消息是在运行时才去绑定的。运行时系统首 阅读全文
posted @ 2016-03-09 14:36 EvansYang 阅读(262) 评论(0) 推荐(0)
摘要:类和对象 类 在Object c中类,其接口(interface)和实现(implementation)是分离开来的 类的声明 @interface 类名:父类名 { 实例变量的定义; } 方法声明; ... @end 类的实现 @implementation 类名 方法定义 ... @end 对象 阅读全文
posted @ 2016-03-06 22:02 EvansYang 阅读(144) 评论(0) 推荐(0)
摘要:Object c基本语法 变量: 变量是只不过是一个名字到存储区域,让程序可以操纵。 Objective C中的每一个变量有特定的类型,确定该变量的存储器的大小和布局,可以存储在该存储器内的值的范围内;和设定操作,可变化应用。 常量: 常数是指为固定值该程序可能不会改变其执行过程中。这些固定的值也被 阅读全文
posted @ 2016-03-05 22:58 EvansYang 阅读(214) 评论(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 阅读(147) 评论(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 阅读(154) 评论(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 阅读(221) 评论(0) 推荐(0)
摘要:Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identical a 阅读全文
posted @ 2016-03-03 09:58 EvansYang 阅读(122) 评论(0) 推荐(0)
摘要:Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. For example, giv 阅读全文
posted @ 2016-03-03 01:01 EvansYang 阅读(162) 评论(0) 推荐(0)
摘要:Invert a binary tree. 4 / \ 2 7 / \ / \ 1 3 6 9 to 4 / \ 7 2 / \ / \ 9 6 3 1 /** * Definition for a binary tree node. * struct TreeNode { * int val; * 阅读全文
posted @ 2016-03-02 21:03 EvansYang 阅读(185) 评论(0) 推荐(0)
摘要:Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process is like: 阅读全文
posted @ 2016-03-02 20:36 EvansYang 阅读(146) 评论(0) 推荐(0)
摘要:Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Supposed the linked list is 1 -> 2 -> 3 - 阅读全文
posted @ 2016-03-02 19:50 EvansYang 阅读(151) 评论(0) 推荐(0)
摘要:Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 click to show spoilers. Have you thought about this? Here a 阅读全文
posted @ 2016-03-02 15:06 EvansYang 阅读(124) 评论(0) 推荐(0)
摘要:You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 ston 阅读全文
posted @ 2016-03-02 15:02 EvansYang 阅读(146) 评论(0) 推荐(0)
摘要:Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest l 阅读全文
posted @ 2016-03-02 15:00 EvansYang 阅读(139) 评论(0) 推荐(0)