Question: 1.(Maximum and minimum ) Implement the following functions that find the maximum and minimum elements in a first-class container: template ElementType maxElement(ContainerType& container){ } template

1.(Maximum and minimum ) Implement the following functions that find the maximum and

minimum elements in a first-class container:

template

ElementType maxElement(ContainerType& container){

}

template

ElementType minElement(ContainerType& container){

}

2. (Occurrence of a value ) Implement the following function that finds the number of occurrences of

a specified value in a first-class container:

template

int countElement(ContainerType& container, const ElementType& value){

}

3. Implement the reverse and reverse_copy functions.

template

void reverse(BidirectionalIterator beg,BidirectionalIterator end){

}

template

OutputIterator reverse_copy(BidirectionalIterator beg,BidirectionalIterator end, OutputIterator targetPosition){

}

4. Implement the replace and replace_if functions.

template

void replace(ForwardIterator beg, ForwardIterator end,const T& oldValue, const T& newValue){

}

template

void replace_if(ForwardIterator beg, ForwardIterator end,boolFunction f, const T& newValue){

}

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 Databases Questions!