由买买提看人间百态

topics

全部话题 - 话题: cbbd
(共0页)
m*****x
发帖数: 2
1
Positions Available in the Center for BioEngineering and BioMedical Devices
(CBBD), Nansha Campus, HKUST Fok Ying Tung Graduate School http://fyt.hkust.edu.cn
A new research center for bioengineering and biomedical devices (CBBD) has
been established in HKUST’s Fok Ying Tung Graduate School since April 2007.
CBBD’s mission is to engage HKUST faculty members and scientists in
applied research activities, particularly with an emphasis to the
development of medical devices, advanced sensors and i
g*******4
发帖数: 155
2
来自主题: JobHunting版 - 贡献一道G家的面试题
处理一个字符串,删除里面所有的A,double所有的B
例子,输入 CAABD, 输出是CBBD
要求in space , O (1), no extra memory cost,因为字符串处理变长的空间不算
J**9
发帖数: 835
3
来自主题: JobHunting版 - 贡献一道G家的面试题
char *hkStringRemoveADoubleB(char *str)
{
if (!str) return NULL;
char *s=str;
char *d=str;
int countb = 0;
int len=0;
while(*s)
{
if (*s=='B') countb++; /// Count B
if(*s!='A') /// Remove A
{
*d++=*s++;
len++;
}
else
s++;
}
if(len)
{
s = str+(len+countb); ///New string length
*s = '\0';
s--;
d--;
while(d!=str)
{
if (*d=='B... 阅读全帖
f**l
发帖数: 44
4
来自主题: JobHunting版 - 贡献一道G家的面试题
Related test cases:
@Test
public void testProcessString() {
String s1 = "CAABD";
String target1 = "CBBD";
Assert.assertEquals(target1, StringAndArray.processString(s1.
toCharArray(), s1.length()));
String s2 = "ACAABDB";
String target2 = "CBBDBB";
Assert.assertEquals(target2, StringAndArray.processString(s2.
toCharArray(), s2.length()));
String s3 = "BACAABDBA";
String target3 = "BBCBBDBB";
Assert.assertEquals(target3, S... 阅读全帖
(共0页)