Array-based member function Assignment
An Unsorted Type ADT is to be extended by the addition of function SplitLists, which has the following specifications:
- 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; }
Assignment Help Features
- 24 x 7 Availability
- Plagiarism Free
- Trained and Certified Experts.
- Deadline Guaranteed
- Privacy Guaranteed
- Assignment Help Reward
- Online help for all project.
- Service for everyone
- Online Tutoring
- Free download.
- Free study help whitepapers
Assignment Help Services
- Assignment Help
- Homework Help
- Writing Help
- Academic Writing Assistance
- Editing Services
- Plagiarism Checker Online
- Proofreading
- Research Writing Help
- Services
Calculator