Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

array_utils.c : #include #include array_utils.h int containsWithin(const int *arr, int size, int x, int i, int j) { //todo return 0; } int contains(const int

image text in transcribed

array_utils.c :

#include

#include "array_utils.h"

int containsWithin(const int *arr, int size, int x, int i, int j) { //todo return 0; }

int contains(const int *arr, int size, int x) { //todo return 0; }

void reverse(int *arr, int size) { //todo return; }

int orderStatistic(int *arr, int size, int i){ int element = -1; //todo

return element; }

int main(){ //you may choose to do your testing here return 0; }

array_utils.h :

//write documentation int containsWithin(const int *a, int size, int x, int i, int j);

//write documentation int contains(const int *a, int size, int x);

//write documentation void reverse(int *arr, int size);

//write documentation int orderStatistic(int *arr, int size, int i);

Write a function that, given an integer array and an integer x determines if the array contains x anywhere within the array. It should return true if it does, false otherwise int contains (const int arr, int size, int x); Write a function that given an integer array and an integer x determines if the array contains x within two provided indices, ij. It should return true if it does, false otherwise int containswithin (const int *arr, int size, int x, nt i, int j); Write a function that, given an array of integers and its size, reverses the elements in the array. For example, if the original array was 10, 15,5, 25, 0] the new array should be [0, 25, 5,15,10 void reverse (int "arr, int size) Order Statistic You'll get more practice with arrays by writing your own version of the Order Statistic program which we have seen in past works. Write a function that takes in an array arr and integer i (that is less than or equal to the number of elements-something to verify in error checking), and returns the i-th smallest element of the array. This function should be implemented without the help of any C Library sorting functions int orderStatistic(int *arr, int size, int i)i

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

Recommended Textbook for

Oracle Database Upgrade Migration And Transformation Tips And Techniques

Authors: Edward Whalen ,Jim Czuprynski

1st Edition

0071846050, 978-0071846059

More Books

Students also viewed these Databases questions