Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

15 Points This is C ++ Data Structures program.The unsorted list must be implemented with pointers. Then write a client code that will have a

15 Points

  • This is C ++ Data Structures program.The unsorted list must be implemented with pointers. Then write a client code that will have a function that will take two unsorted lists and perform the union set operation. The resulting new unsorted list will consist of all the unique items from the original two lists with no duplicates.
    • Class Names: ItemType, UnsortedType
      • Attributes:
        • Max items A constant specifying the maximum number of items to be on the list.
        • ItemType A class encapsulating the type of the items in the list.
        • RelationType An enumeration type that consists of LESS, GREATER, EQUAL
        • Front pointer A pointer to the first item in the list
        • Position pointer A pointer to the current position in the list.
      • Methods:
        • Search Search list for a given item.
          • Precondition Given a value to search for and the object has been created.
          • Postcondition A pointer to the location is returned or NULL pointer is return if no such item exists.
        • InsertItem Adds item to the list.
        • DeleteItem Deletes the element whose key matches items key.
        • GetNextItem Updates position pointer to next item in the list.
        • MakeEmpty Initializes list to empty state.
        • IsFull Determines whether list is full.
        • ResetList Initializes current position to front of the list.
        • ComparedTo Determines the ordering of two ItemType objects based on their keys.
        • GetLength Determines the number of elements in list.
        • Union The mathematical set operation of union is performed on two given lists and a new list is created with unique elements from both lists.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Handbook Of Database Security Applications And Trends

Authors: Michael Gertz, Sushil Jajodia

1st Edition

1441943056, 978-1441943057

More Books

Students also viewed these Databases questions