Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

XYZ Produce Company stores its data file, Vegetables.txt, in the following format. Code VName QTY Price SName LSV0001 Amaranth 500 0.12 Amaranthus cruentus LSV0002 Arugula

XYZ Produce Company stores its data file, Vegetables.txt, in the following format.

Code VName QTY Price SName

LSV0001 Amaranth 500 0.12 Amaranthus cruentus LSV0002 Arugula 234 0.05 Eruca sativa

LSV0003 Beet (greens) 590 0.20 Beta vulgaris vulgaris

: : : : :

: : : : :

XYZ Company is looking for a more efficient way to find the QTY or Price for a certain VName. You are hired by XYZ Company and is responsible for this task. Meanwhile, youve learned only two ADT: Linked Lists and Binary Search Tree. Therefore, you have to build both ADTs and compare them to find the better one.

Once you build up both ADTs, you will use the test data to find the number of comparisons required to locate a certain VName. For example,

For Amaranth requires 25 comparisons in the Linked Lists and 20 in the Binary Search Tree.

Therefore, Binary Search Tree is better than Linked Lists.

Data: 1) Chinese mallow

2) Spinach

3) Broccoli

4) Okra

5) Ginger

Requirements: 1) Use these test data above for your program.(write the program in C++)

2) Please turn both your source code and the output.

Note: Use screen print to capture the output according to the specified test data.

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

Web Database Development Step By Step

Authors: Jim Buyens

1st Edition

0735609667, 978-0735609662

More Books

Students also viewed these Databases questions