順序付けられた文字列リストオブジェクトを作成する必要がある割り当てがあります。私は現在2つの順序付けられた文字列リストを持っており、それぞれに7つの文字列値が含まれています。リストmyListとyourListを結合リストcombinedListにマージするメソッドを作成しようとしています。
これが私がこれまでに持っているものです。
public boolean merge(OrderedStringList myList, OrderedStringList yourList){
int index;
String value;
for (index = 0;index < numUsed; index++){
value = myList.storage[index];
combinedList.insert(value);
}
for (index = 0;index < numUsed; index++){
value = yourList.storage[index];
combinedList.insert(value);
}
}
メインでオブジェクトcombinedListを宣言しましたが、orderedStringList.classで認識されません。
挿入関数は、文字列をアルファベット順に挿入します。