码迷,mamicode.com
首页 >  
搜索关键字:isempty    ( 460个结果
CC150 3.5
3.5ImplementaMyQueueclasswhichimplementsaqueueusingtwostacks.interfaceQueue<T> { enqueue(Tt); Tdequeue(); } classMyQueue<T>implementsQueue<T> { MyQueue() { //Initstackss1ands2; ... } //O(n) enqueue(Tt) { while(!s2.isEmpty()) { s1.push(s2..
分类:其他好文   时间:2014-11-27 08:05:14    阅读次数:140
CC150 3.6
3.6Writeaprogramtosortastackinascendingorder.Youshouldnotmakeanyassumptionsabouthowthestackisimplemented.Thefollowingaretheonlyfunctionsthatshouldbeusedtowritethisprogram:push|pop|peek|isEmpty.interfaceStack<T> { push(Tt); Tpop(); Tpeek(); booleanisEm..
分类:其他好文   时间:2014-11-27 08:02:46    阅读次数:156
判断文字是否为空格 (一个或者多个空格)
// 判断文字是否为空格 (一个或者多个空格) -(BOOL)isEmpty:(NSString *)str{ if (!str) { returntrue; } else { NSCharacterSet *set = [NSCharacterSetwhitespaceA...
分类:其他好文   时间:2014-11-26 10:56:09    阅读次数:175
Swift 集合类型
swift中集合类型有数组和字典数组和字典的区别是数组是有序的,字典类型是无序的 字典有key值1.数组的定义和更新数组的定义是Array 或者[sometype]var 山手线=["日暮里","鹰谷"]山手线.count 可以用来查看数组的个数山手线.isEmpty 可以用来判断数组是否是空的在数...
分类:编程语言   时间:2014-11-16 14:41:01    阅读次数:206
Swift 字符串和字符
swift中的字符串和字符都兼容unicode定义一个字符串let hello="hello world"初始化一个空的字符串let hello=""let hello=String()判断一个字符串是否为空if hello.isEmpty{println("这是个空字符串")}字符串可以使用+进行...
分类:编程语言   时间:2014-11-16 13:15:20    阅读次数:241
Collection、Iterator、Set、HashSet
Collection接口的基本方法boolean add(Object o)向集合当中加入一个对象void clear()删除集合当中的所有对象boolean isEmpty()判断集合是否为空remove(Object o)从集合中删除一个对象的引用int size()返回集合中元素的数目Set接...
分类:其他好文   时间:2014-11-15 23:11:04    阅读次数:278
isNull、isEmpty、lenth = 0的区别
isNull Null 值:变量卜存在,不包含有效数据,未定义,为分配内存 isEmpt 是一个判断函数,返回false或者true。 ?public?boolean?isEmpty()?{? return?size?==?0;? ????} “” 已初始化,已分类内存...
分类:其他好文   时间:2014-11-14 12:43:58    阅读次数:142
Java 实现简答的单链表的功能
定义了一个MyList类 包含的函数: getHead()返回头指针; isEmpty() 判断是否为空; addFirst(T element)在链表的头部加入元素; addLast(T element)在链表的尾部加入元; add(T fix...
分类:编程语言   时间:2014-11-12 21:23:08    阅读次数:268
判断QString是否为纯数字
bool IsDigitString(QString strSource){ bool bDigit = false; if (strSource.isEmpty()) { return bDigit; } QByteArray strByteArray = strSource....
分类:其他好文   时间:2014-11-09 00:54:16    阅读次数:1072
使用递归算法反转字符串
public class T { //反转字符串 public static String reverseString(String s){ if(s.isEmpty()) return s; return reverseString(s.substring(...
分类:编程语言   时间:2014-11-06 09:15:31    阅读次数:169
460条   上一页 1 ... 39 40 41 42 43 ... 46 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!