Question: 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 1.1P work through the following steps to complete
the task:
1. 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.
2. 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 zero-based index of the element, if item is found; otherwise, a negative number (e.g.-1). 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 zero-based index of the element, if item is found; otherwise, a negative number (e.g.-1).
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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!