Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Task Details Using the Vector class you implemented as part of Task 1 . 1 P work through the following steps to complete the task:
Task Details
Using the Vector class you implemented as part of Task P work through the following steps to complete
the task:
Explore the program code attached to this task. Create a new Microsoft Visual Studio project and
import the Vector.cs file, or alternatively, extend the project inherited from the previous tasks by
copying the missing code from the enclosed template for the Vector class. Import the Tester.cs
file to the project to access the prepared Main method important for the purpose of debugging and
testing the required algorithmic solution.
In the first part of this task, you must further extend the Vector class to enable searching an
element in a sequence of generic data elements using the recursive version of Binary Search. You
must add the following functionality to the class:
int BinarySearch T item
Searches within the entire sorted Vector for an element using the default comparer and returns
the zerobased index of the element, if item is found; otherwise, a negative number eg This
method uses the default comparer Comparer.Default for type T to determine the order of the
elements in the Vector.
int BinarySearch T item, IComparer comparer
Searches within the entire sorted Vector for an element using the specified comparer and returns
the zerobased index of the element, if item is found; otherwise, a negative number eg
Note that you are not allowed to delegate the binary search operation to the Array class or any other
collection classes. You must implement the Binary Search algorithm from scratch. To learn the
similarity with the standard List class of NE
Step 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