Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in c++ pleaseeeee asap 5. Write the code for a function int getIndex( int arr|l, int size, int value) which returns the index of value

in c++ pleaseeeee asap image text in transcribed
image text in transcribed
5. Write the code for a function int getIndex( int arr|l, int size, int value) which returns the index of value inside the array, if value not found it should return -1. ( 10 points) getIndex (a,10,5)3 getIndex (a,10,50)1 6. Write a function bool isSorted(int all, int size) to check if a given array is sorted or not. For example: a={1,2,13,24,35} should return true, b={1,2,5,4,3} returns false. 7. write a function that merges two sorted arrays, (15 points) Merge (int al], int b[], int c[], int size), assume a and b both have the same size, and c always has the double size of them. for example: (15 points) a[3]={1,3,5}; b[3]={2,4,6}; Then retult should be c[6]={1,2,3,4,5,6}; Examples: if the array contains the following elements, the function should return false. Because value 1 is repeated. Even, if only one character appeared twice the function should return false. if the array contains the following elements, the function should return true. Because none of the characters is repeated. 4. Define and call the function isPalindrome, which check if the array consists of two parts where the second part is the reverse the first part. For example (1,2,3,3,2,1). Assume that the size of array is always even. ( 15 points) bool isPalindrome(int arr\|, int size) For example: Array (1,2,3,3,2,1) should return true Array (1,2,3,1,2,3) should return false

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

Database Processing

Authors: David M. Kroenke

12th Edition International Edition

1292023422, 978-1292023427

More Books

Students also viewed these Databases questions

Question

Why are standard cost systems used?

Answered: 1 week ago

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago