• +1-617-874-1011 (US)
  • +44-117-230-1145 (UK)
Online Customer Service
Follow Us:

Array-based member function Assignment

An Unsorted Type ADT is to be extended by the addition of function SplitLists, which has the following specifications:

  1. Implement SplitLists as an array-based member function of the Unsorted List ADT.
    void SplitLists(const UnsortedType& list, ItemType item,
UnsortedType& list1, UnsortedType& list2)
{
ItemType listItem;
list1.MakeEmpty();
list2.MakeEmpty();
list.ResetList();
while (!list.IsLastItem()) {
list.GetNextItem(listItem);
if(listItem > item)
list2.InsertItem(listItem);
else
list1.InsertItem(listItem);
}
}

b. Implement SplitLists as a linked member function of the Unsorted List ADT.

bool IsThere(ItemType item) const;
bool UnsortedType:: IsThere(itemType item)
{
Bool moreToSearch;
Int location =0;
Found = false;
Moreto Search = (location < length);
While(moreToSearch && !found)
{
switch(item.ComparedTo(info[location]))
{
Case LESS:
Case GREATER: location ++;
moreToSearch = (location< length);
break;
}
}
Return found;
}
Want a fresh copy of this Assignment

Resources

  • 24 x 7 Availability.
  • Trained and Certified Experts.
  • Deadline Guaranteed.
  • Plagiarism Free.
  • Privacy Guaranteed.
  • Free download.
  • Online help for all project.
  • Homework Help Services
Tap to Chat
Get Instant Assignment Help
Tap to Chat
Get Instant Assignment Help