編輯:關於Android編程
Eliminate all ‘b’ and ‘ac’ in an array of characters, you have to replace them in-place, and you are only allowed to iterate over
the char array once.
Examples:
abc -> ac
ac->''
rbact->rt
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
The key point is in-place and iteration once.
int eliminate( char* p)
{
int deleted = 0;
if (! p )
return deleted;
while (*p){
if (*p == 'b')
deleted++;
else if ( ( *p == 'a' ) && ( *(p+1) == 'c')){
deleted += 2;
p++;
}
else if ( deleted > 0 )
*(p-deleted) = *p;
p++;
}
*(p-deleted) = '\0';
return deleted;
}
修改Android Studio的Android SDK Path
為什麼要修改路徑呢……因為我之前裝過Eclipse,也裝過Android SDK,但是昨天裝Android Studio的時候不小心又裝了一個
Android ORM 框架——greenDAO
greenDAO 是一個將對象映射到 SQLite 數據庫中的輕量且快速的 ORM 解決方案。 官方網站http://greendao-orm.com/ 讓我們開始吧
Android中WebView的一些簡單用法
Android中WebView的一些簡單用法一直想寫一個關於 WebView 控件的 一些簡單運用,都沒什麼時間,這次也是擠出時間寫的,裡面的一些基礎知識就等有時間再更新
Android消息機制Handler解析(源碼+Demo)
Handler是開發人員在面試過程中最常見的問題之一了,這篇文章將較為全面地對Handler進行解讀,包括源碼層,以及使用方法。如果看完文章有疑問,歡迎在評論中一起探討基