Posts

Showing posts with the label Range Binary Search Tree

Design the BigString class

Problem [Revised] Design the BigString class which has the following public methods // method to add char to the word at the specified index. void insert (char c, int pos) {   // } //method to return the word at the specified index. word * search(int index) { // } Example) insert('a', 0); ==> [a] insert('b', 0); ==> [ba] insert(' ', 0); ==> [ ba] insert('c', 0); ==> [c ba] insert('e', 11) ==> [c ba       e] insert('f', 8); ==> [c ba    f   e] insert('o', 3)  ==> [c boa    f   e] insert('u', 10) ==> [c boa    fu   e] search(0) ==>  c search(1) ==>  boa search(2) ==>  fu search(3) ==>  e