CCI_chapter 1
2013-08-17 16:31
316 查看
1.1Implement an algorithm to determine if a string has all unique characters What if you can not use additional data structures?
View Code
bool isRotation(string s1, string s2){ if(s1.size() != s2.size()) return false; if(s1.size() == 0) return true; string ss = s1+ s1; if(string::npos != ss.find(s2)) return true; return false ; }
View Code
相关文章推荐
- CCI_chapter 2 Linked Lists
- CCI_chapter 3 Stacks and Queues
- CCI_chapter 13C++
- CCI_chapter 16 Low level
- CCI_chapter 19 Moderate
- CCI_chapter 4 trees and Grapths
- CCI_chapter 8 Recurision
- Chapter 3.GDI/DirectDraw Internal Data Structures
- C++ Primer 5th Chapter 6 学习笔记
- Android Animation(chapter1 目录)
- Beginning Python Chapter 1 Notes
- Chapter 1-03
- 《Hadoop:The Definitive Guide 4th Edition》Chapter 1 Meet Hadoop
- chapter 15 使用canvas绘图
- Chapter 1. Hello, Perl/Tk
- CCI project
- chapter 9.Dictionaries
- Chapter 8:Holding your objects
- Chapter 5 图像复原和重建
- Chapter 4. Overview of .NET Framework Classes