Computers and Technology
Computers and Technology, 19.02.2020 03:31, xcapo1x

Array manipulationWrite the following array functions. You can assume that these are integer arrays. You implementation should not use [ ] operators. Instead use pointers to access array elements. Suppose, arr[] = {1, 4, 6, 5, 2, 7, 10}.A. Search for a given value in the array and return the index of the location. Return - 1 if not found in the array. void search(int arr[], int n, int val); Using the above array arr, search(arr, 7, 6) should return 2, and search(arr, 7, 8) should return -1.B. Reverse the contents of the array. void reverse(int arr[], int n); Using the above array arr, reverse(arr, 7) should return result in arr contents rearranged as follows: arr = {10, 7, 2, 5, 6, 4, 1}.C. Rearrange the array such that all the odd elements in the array are in the beginning of the array. void oddFirst(int arr[], int n); Using the above array arr, oddFirst(arr, 7) should return result in arr contents rearranged as follows: arr = {1, 5, 7, 4, 6, 2, 10}.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 18:00, adrianaglass12
Which virus-infecting components are email messages prone to carry? one of the problems associated with the use of email communication is that email messages are prone to carry virus-infecting .
Answers: 3
image
Computers and Technology, 23.06.2019 00:00, destinysmithds7790
Suppose you have 9 coins and one of them is heavier than others. other 8 coins weight equally. you are also given a balance. develop and algorithm to determine the heavy coin using only two measurements with the of the balance. clearly write your algorithm in the form of a pseudocode using the similar notation that we have used in the class to represent sorting algorithms
Answers: 1
image
Computers and Technology, 23.06.2019 05:20, reeeeeee32
What did creator markus “notch" persson initially call his game
Answers: 1
image
Computers and Technology, 23.06.2019 18:00, teamroper35
Which finger presses the h key on the keyboard? index finger on the left hand pinky finger on the right hand index finger on the right hand thumb on the left hand
Answers: 1
Do you know the correct answer?
Array manipulationWrite the following array functions. You can assume that these are integer arrays....

Questions in other subjects:

Konu
English, 12.02.2020 17:44
Konu
Social Studies, 12.02.2020 17:44
Konu
World Languages, 12.02.2020 17:44