Answered step by step
Verified Expert Solution
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.
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 respectivelyStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started