已知字符串:a=“an apple”,b=“other hero”,c=“her”,求: (1)concat(substr(a,1,2),b)。 (2)replace(a,substr(a,5,1),c)。 (3)index(a,c)和index(b,c)。
假定用一個單循環(huán)鏈表來表示隊列(也稱為循環(huán)隊列),該隊列只設一個隊尾指針,不設隊首指針,試編寫下列各種運算的算法: (1)向循環(huán)鏈隊列插入一個元素值為x的結點; (2)從循環(huán)鏈隊列中刪除一個結點。