Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Kuwait University Spring 2020 College of Engineering and Petroleum Cpr 207: Data Structures Department of Computer Engineering Alarithms Assigument # 2: Algorithms Analysis + Arrays

image text in transcribed

Kuwait University Spring 2020 College of Engineering and Petroleum Cpr 207: Data Structures Department of Computer Engineering Alarithms Assigument # 2: Algorithms Analysis + Arrays L'lease uploud a solt copy on Schology Instructions: Your assignment should represent your own lart flowever, it is fine to discuss the exercises and try to find solutions together, but each student shall write down and submit his/her solutions separately. For a programming task your solution must contain the JAVA code, in a form that we can run for all progranung tasks, it is not allowed to use any external libraries ("import if not sued therwise. Please, include name, student ID and email address in your submission A. Implementation of the hasic operations of the dass Arrayulity, which offers basic operations uver une dimensional and Lu-dimensional arrays. All methods must be implemented as class methods (ie, static methods. The sigature of the methods in the Array Utility class are the following 1. public static int findMax(int[] a, int i, int J): returns the m u m value occurring in the array A hetween position and 2. public static int findMaxPos(int[] A int 1, int 1); returns the position of the maximum value in the array Abuween position i and j. 3. public static int findin(int[] a, int n, int 3): returns tho minimum value in the array A between position i andi. 4. public static int findMinPos(int[] a, int i, int j): return the position of the minimum value in the alTay A between position and 5. public static void swap(int[] a, int i, int j): swaps the olements in position and in the array A public static void shiftRight(int[] a, int i, int 1): sluits to the right all the elements of the array A starting from position and until position ( L oves the element in position kto position k. 1 for all iskc and leaves position unchanged 7. public static void shift left(int[] a, int i, int j): shills to che left all the elements of the array Afron position down to positioni , moves the element in position to position k-1 for all 1cks, and leaves the position unchanged). a. public static int[] createRandomArray(int size, int min, int max): creates and returns an alray of size size of random elements with values between min and max (use the Math.random() in the flavu!)

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

Students also viewed these Databases questions

Question

9. Understand the phenomenon of code switching and interlanguage.

Answered: 1 week ago