Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

###Solve in Python*** Task 1 on Key index Searching & Sorting Create a KeyIndex class with the following properties : Fields: int [ ] k;

###Solve in Python***

Task 1 on Key index Searching & Sorting

Create a KeyIndex class with the following properties : Fields: int [ ] k; Description An array of integers.

Note: You may maintain another global variable(java)/instance variable(python) if needed (but you cant use more than one).

Constructor:(10 marks) KeyIndex(int [ ]a) Description: This constructor takes an array of integers a and populates array k with the element in a as indices into k. Note: make sure the build-up of your array k supports negative and non-distinct integers. Methods: search (int val) (5 marks) Description: This method searches for the value val within the array and returns true if found or false otherwise. sort () (10 marks) Description: This method will return the sorted form of the array that had been passed into the constructor. NOTE: Create a tester class or write tester statements to check whether the methods in your KeyIndex class work properly. You need to submit both the classes as a part of your assignment. (5 marks)

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_2

Step: 3

blur-text-image_3

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

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions

Question

Evaluate the importance of the employee handbook.

Answered: 1 week ago

Question

Discuss the steps in the progressive discipline approach.

Answered: 1 week ago