logo
+1-617-874-1011 (US)
+61-7-5641-0117 (AU)
+44-117-230-1145 (UK)
Live Chat

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 sample assignment
Improve Your Grades with Custom Writing Help
Homework Help
Writing Help
Editing Services
Plagiarism check
Proofreading services
Research Project help
Custom writing services
scanner
E learning blogs

Disclaimer : The study tools and academic assistance/guidance through online tutoring sessions provided by AssignmentHelp.Net is to help and enable students to compete academically. The website does not provide ghostwriting services and has ZERO TOLERANCE towards misuse of the services. In case any user is found misusing our services, the user's account will be immediately terminated.