insert element into array problem

Hi,

I have problem about how to insert value into an array. here is one section, could anyone help me to insert input value into array and delete the first value in the array.Gap means to fill in code

void Ins(String name)

// Insert name or increment its multiplicity.

// If the bag is full remove the oldest entry.

{

int i;// Running index on BagName

int target;// if target < n then name.equals(BagName[target]);

// else target == n

Date EntryDate;// Current date and time

// Get current date and time

EntryDate = new Date();

BagDate[n] = EntryDate.toString();

Mult[n] = n+1;

BagName[n] = name;

n++;

// Search bag for name

// Gap 2

// Assertion: target < n => name.equals(BagName[target])

//else target == n

// Update Mult if target < n

// Gap 3

// Make room for and insert name if target not found

} // Ins(String name)

Message was edited by:

sibojava

Message was edited by:

sibojava

[1098 byte] By [sibojavaa] at [2007-11-26 20:14:18]
# 1
Do you have several accounts?See this thread, it's the same question: http://forum.java.sun.com/thread.jspa?threadID=5143232Kaj
kajbja at 2007-7-9 23:20:39 > top of Java-index,Java Essentials,Java Programming...