subject
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}.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 04:30
Kyle, a receptionist for a building supply company, recently won an award for saving his company money on their phone system. after being presented with kyle's research, the company changed the way in which it made long-distance phone calls and cut their expenses in this area by 75 percent. the new system the kyle's company most likely adopted was wired communications switching stations voip hdtv
Answers: 3
question
Computers and Technology, 22.06.2019 20:00
The blank button automatically displays next to the data when you select a range of numeric data which is an available option for creating a chart
Answers: 3
question
Computers and Technology, 22.06.2019 20:10
Assume the existence of a bankaccount class. define a derived class, savingsaccount that contains two instance variables: the first a double, named interestrate, and the second an integer named interesttype. the value of the interesttype variable can be 1 for simple interest and 2 for compound interest. there is also a constructor that accepts two parameters: a double that is used to initialize the interestrate variable, and a string that you may assume will contain either "simple", or "compound", and which should be used to initialize the interesttype variable appropriately. there should also be a pair of functions getinterestrate and getinteresttype that return the values of the corresponding data members (as double and int respectively).
Answers: 2
question
Computers and Technology, 22.06.2019 22:20
Pp 4.1 design and implement a class called sphere that contains instance data that represents the sphere’s diameter. define the sphere constructor to accept and initialize the diameter and include getter and setter methods for the diameter. include methods that calculate and return the volume and surface area of the sphere (see pp 3.5 for the formulas). include a tostring method that returns a one-line description of the sphere. create a driver class called multisphere, whose main method instantiates and updates several sphere objects.
Answers: 1
You know the right answer?
Array manipulationWrite the following array functions. You can assume that these are integer arrays....
Questions