The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 407 Weeks Ago, 6 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
1.
(1)Create a string function that takes two input strings,stringAandstringB,and returns a 0 if both strings are the same, a 1 ifstringA appears beforestringBin the sorted order of a dictionary, or a 2 ifstringBappears beforestringA.
(2) Using this function, and modify the Insertion Sort program on page 448 of textbook so that it operates upon strings instead of integers.
3.Write a program to find the median of a set of numbers. Recall that the median is a number within the set in which half the numbers are larger and half are smaller.Hint:To perform this, you may need to sort the list first.
4.Consider the following declarations.
#define STACK_SIZE 100
int stack[STACK_SIZE];
int topOfStack;
int Push(int item);
Â
(1).Write a function Push (the declaration is provided) that will push the value of item onto the top of the stack.Ifthe stack is full and the item cannot be added, the function should return a -1.Ifthe item is successfully pushed, the function should return a 0.
(2).Write a function Pop that will pop an item from the top of the stack. (The declaration is not provided, you have to design it)
Like Push, this function will return a -1 if the operation is unsuccessful. That is, a Pop was attempted on an empty stack. It should return a0if successful.
Consider carefully how the popped value can be returned to the caller.
Â
</pstyle="margin:>
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------pos-----------ted----------- so-----------lut-----------ion-----------.Pl-----------eas-----------e p-----------ing----------- me----------- on-----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be-----------