Question: Each problem has to be done in 3 parts. Classes have to be created. Example- problem01. main, .cpp, .h and all solution give me output

Each problem has to be done in 3 parts. Classes have to be created. Example- problem01. main, .cpp, .h and all solution give me output screenshot.

Each problem has to be done in 3 parts. Classes have to

1. Given an unsorted array of N integers (N > 0) and an integer value x, write the function that returns zero-based index in the array at which the value x is located. Function should return negative value if array does not contain x. In case that there are multiple occurrences of x within the array, return smallest index at which x occurs. Example: Suppose that array is: 9, 2, 6, 8, 1, 4, 5. For x=6 function returns 2. For x=3, function returns negative value (e.g. -1). 2. Write a program to reverse a string using stack. Hints: a) Create an empty stack. b) One by one push all characters of string to stack. c) One by one pop all characters from stack and put them back to string. 3. Given two unsorted arrays of integer numbers, write a function which returns number of elements that exist in both arrays. Elements may be repeated in any of the arrays, and all common appearances should be counted. Example: Suppose that the first array is 3, 1, 4, 1, 2 and the second array is 5, 1, 2, 4, 2, 1. Common elements of the two arrays are 1, 1, 2 and 4, and therefore the function should return result 4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!