码迷,mamicode.com
首页 >  
搜索关键字:return    ( 60766个结果
Binary Tree Zigzag Level Order Traversal
题目 Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between). For example: G...
分类:其他好文   时间:2014-06-08 17:29:07    阅读次数:315
Binary Tree Level Order Traversal
题目  Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example: Given binary tree {3,9,20,#,#,15,7}, 3 / \...
分类:其他好文   时间:2014-06-08 16:38:02    阅读次数:194
黑马程序员_Objective C中的@property 与 @synthesize 快速生成setter getter方法
一般来说在一个类中 成员变量是会有setter 跟getter方法的。 如果每一个成员变量的setter 跟getter方法都要手写出来的话 很麻烦 很耗时 而且 大部分setter 跟getter方法内容都是简单的赋值 跟return   所以 有些成员变量 没必要手写setter 跟getter方法 @property int age; 这句话代表着 声明setAge:(in...
分类:其他好文   时间:2014-06-08 16:33:15    阅读次数:192
检查输入的用户名是否符合规定
代码清单: <?php /** * 检测输入中是否含有错误字符 * @author ruxing.li * @param char $string 要检查的字符串名称 * @return boolean */ function is_badword($string) { $badwords = array("\\",'&',' ',"'",'"','/','*',',',''...
分类:其他好文   时间:2014-06-08 14:49:48    阅读次数:288
判断字符串是否为 utf-8 编码
代码清单: <?php /** * 判断字符串是否为utf8编码,英文和半角字符返回ture * @author ruxing.li * @param $string * @return bool */ function is_utf8($string) { return preg_match('%^(?: [\x09\x0A\x0D\x...
分类:其他好文   时间:2014-06-08 10:47:58    阅读次数:267
格式化文本域内容
本函数对 form 表单提交过来的 textarea 文本域的内容进行处理。 代码清单: <?php /** * 格式化文本域内容 * @author ruxing.li * @param $string 文本域内容 * @return string */ function formatTextarea($string) { $string = nl2br ( str_re...
分类:其他好文   时间:2014-06-08 10:36:42    阅读次数:184
Binary Tree Level Order Traversal II
题目 Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For example: Given binary tree {3,9,20...
分类:其他好文   时间:2014-06-08 09:23:34    阅读次数:230
[LeetCode] Remove Element [20]
题目 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't matter what you leave beyond the new length. 原题链接(点我) 解题思路 给一个数组和一个数字,移除该数字在数组中所有出现的地方。 这是一个非常简单的题目,应...
分类:其他好文   时间:2014-06-08 04:05:50    阅读次数:284
[LeetCode] Remove Duplicates from Sorted Array [19]
题目...For example,Given input array A = [1,1,2],Your function should return length = 2, and A is now [1,2]. 解题思路, 移除数组中的重复元素,并返回新数组的长度。 这个题目应该算是简单的题目。使用两个变量就可以。具体的看代码 代码实现......
分类:其他好文   时间:2014-06-08 03:54:22    阅读次数:279
LeetCode——Two Sum
Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up to the target, whe...
分类:其他好文   时间:2014-06-08 02:12:04    阅读次数:216
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!