ITeye博客

2011 年文章归档

共 8 篇文章

iphone project note

Property Declaration Attributes You can decorate a property with attributes by using the form @property(attribute [, attribute2, ...]) . Like methods, properties are scoped to their enclosing interface declaration. For property declarations that use a comma-delimited list of variable names, the pro…

2011-11-08 16:56 · iPhone Development · Objective-C · iPhone

iPhone 开发:Dictionary

Notice: This article is just a note. Here are some more important facts about NSDictionary: • Whenever you add an object to a dictionary, the dictionary retains it. Whenever you remove an object from a dictionary, the dictionary releases it. • There can only be one object for each key. Therefore, i…

2011-11-04 12:19 · iPhone Development · Objective-C · Cocoa · Apple

iPhone 开发:UITableView and UITableViewController

注:本文是一份学习笔记。 UITableViewCell is a subclass of UIView, and each row in a UITableView is represented by a UITableViewCell. (Recall that a table on the iPhone can only have one column, so a row will only have one cell.) A UITableView asks its data source for the cells it should display when it is firs…

2011-10-31 17:11 · iPhone Development

iPhone 开发:Notification

注:本文是一份学习笔记。 Notifications: In every application, there is an instance of NSNotificationCenter, which works like a smart bulletin board. An object can register as an observer (“Send any ‘lost dog’ notifications to me.”). When another object posts a notification (“I lost my dog.”), the notification …

2011-10-31 15:57 · iPhone Development

贪心算法(Greedy Algorithms)

贪心算法 适用于最优化问题的算法往往包含一系列步骤,每一步都有一组选择。贪心算法是使所做的选择看起来是当前最佳的,期望通过所做的局部最优解来产生出一个全局最优解。贪心算法对大多数优化问题来说可以产生最优解,但并不一定总是这样的。贪心算法的两个经典例子是最小生成树算法和Dijkstra单源最短路径算法。 1贪心策略的基本内容 贪心算法是通过做一系列的选择来给出某一问题的最优解。对算法中的每一个决策点,做一个当时看起来最佳的选择。这种启发式的策略并不是总能产生最优解,但它常常能给出最优解。 一般地,根据以下步骤设计贪心算法: (1) 将优化问题转化为这样的一个问题:先做出选择,再解决剩下的一个子…

2011-10-29 13:38 · Algorithms

Cocoa Touch Design Pattern - delegation(未完待续)

注:本文是一份学习笔记。 cocoa touch由苹果公司提供的软件开发api, 用于开发 iphone\ipod\ipad上的软件。也是苹果公司针对iPhone应用程序快速开发提供的一个类库。此库以一系列框架库的形式存在,支持开发人员使用用户界面元素构建图像化的事件驱动的应用程序。 Cocoa Touch 层由多个框架组成,他们为应用程序提供了核心功能。 UIKit 负责启动和结束应用程序,控制界面和多触点事件 Map Kit 提供地图的相关服务 Game Kit 创建和使用网络机制 Message UI/Adress Book UI 提供操作电子邮件和联系人的信息 A callback …

2011-10-26 17:02 · iPhone Development

快速排序(QuickSort)

[size=large]QuickSort 一 Introduction 快速排序的最坏运行时间是Θ(n²);但在实践上它常常是最好的算法,因为它在平均情况下的期望运行时间是Θ(n lg n),而且隐藏在Θ(n lg n)里面的常量因子是很小的。同时,它是一种原地排序算法,在虚拟内存上也工作良好。 另外,通过随机函数可以极大降低最坏情况的出现概率。 二 算法描述 快速排序算法和归并排序一样,是一种基于分治思想(divide-and-conquer)的排序算法。以下是对数组A[p...r]中的元素进行快速排序的过程。 Divide: Partition (rearrange) the arra…

2011-10-03 14:50 · Algorithms

About This Blog

Hello,everyone,welcome to my blog. This blog will focus on data structure and algorithm. When introduce an algorithm, I will describe the theory as well as an implementation in one of my familiar language. Algorithm, programing,design are the basic skills for an software engineer,so this blog will …

2011-09-30 21:45 · Others