Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN C++ It should contain arrayList.h, sortedarrayList.h, linkedListList.h and main.cpp main.cpp is attached below. The main file The user interface for your searching algorithms is

IN C++

It should contain arrayList.h, sortedarrayList.h, linkedListList.h and main.cpp

main.cpp is attached below.

image text in transcribedimage text in transcribed

The main file The user interface for your searching algorithms is provided in a file called main.cpp. The user selects what searching algorithm needs to be run and on what data structure. Your task in this lab is to be able to implement the searching algorithms. The data structures required for this assignment are arrays, sorted arrays, and linked lists. You may use arrays and linked lists from your previous assignments or use the solution to labs 3 and 4 that will be released on 11/06. Searching algorithms on unsorted arrays Implement sequential search on the arrayList data structure from Lab 3 as a member function called unsigned int seqSearchIter (elemType element) and unsigned int seqSearchRec (elemType element) that returns the index at which the element is present using iteration and recursion respectively Searching algorithms on sorted arrays Create a new template called sortedarrayList in a file called sortedarrayList.h with the functionalities as follows: Function Constructors Destructors bool isEmpty() const bool isFull) const int listsize() const int maxListsize() const void print() bool insert(elemType) void remove (elemType) void clearList() Description Decide if you need to use any parameters Especially required if you use dynamic memory management Checks if list is empt Checks if list is full Returns the size of the list Returns the maximum possible size of the list Prints the elements of the list on the console Inserts an element into the sorted list Removes element from the list Empties the list Implement binary search on the sortedarrayList data structure as a member function called unsigned int binarySearchIter (elemType element) and unsigned int binarySearchRec (elemType element) that returns the index at which the element is present using iteration and recursion respectively Searching algorithms on linked lists Implement sequential search on the linkedListList data structure from Lab 4 as a member function called bool seqSearchIter (elemType element) and bool seqSearchRec (elemType element) that returns true if the element is present in the array and false otherwise, using iteration and recursion respectively The main file The user interface for your searching algorithms is provided in a file called main.cpp. The user selects what searching algorithm needs to be run and on what data structure. Your task in this lab is to be able to implement the searching algorithms. The data structures required for this assignment are arrays, sorted arrays, and linked lists. You may use arrays and linked lists from your previous assignments or use the solution to labs 3 and 4 that will be released on 11/06. Searching algorithms on unsorted arrays Implement sequential search on the arrayList data structure from Lab 3 as a member function called unsigned int seqSearchIter (elemType element) and unsigned int seqSearchRec (elemType element) that returns the index at which the element is present using iteration and recursion respectively Searching algorithms on sorted arrays Create a new template called sortedarrayList in a file called sortedarrayList.h with the functionalities as follows: Function Constructors Destructors bool isEmpty() const bool isFull) const int listsize() const int maxListsize() const void print() bool insert(elemType) void remove (elemType) void clearList() Description Decide if you need to use any parameters Especially required if you use dynamic memory management Checks if list is empt Checks if list is full Returns the size of the list Returns the maximum possible size of the list Prints the elements of the list on the console Inserts an element into the sorted list Removes element from the list Empties the list Implement binary search on the sortedarrayList data structure as a member function called unsigned int binarySearchIter (elemType element) and unsigned int binarySearchRec (elemType element) that returns the index at which the element is present using iteration and recursion respectively Searching algorithms on linked lists Implement sequential search on the linkedListList data structure from Lab 4 as a member function called bool seqSearchIter (elemType element) and bool seqSearchRec (elemType element) that returns true if the element is present in the array and false otherwise, using iteration and recursion respectively

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

Expert Performance Indexing In SQL Server

Authors: Jason Strate, Grant Fritchey

2nd Edition

1484211189, 9781484211182

More Books

Students also viewed these Databases questions

Question

Provide examples of Dimensional Tables.

Answered: 1 week ago