Exercise 12:

Create a directory ex12 and store in this directory all the files corresponding to this exercise.

Question 1: stl containers.

For the exercise 2, question 1, you had to write an array-based stack. While keeping the same public interface, please rewrite this Stack class using a double-linked list instead of the array. Use std::list<int> from the standard library as an implementation of a linked list.
The following functions from list<T> will be useful:

Note that list<T> can grow by reallocating memory but we will be keeping the semantic of the original Stack and limit the maximal size of the stack to max_size (which is initialized at the construction).

Question 2: containers and iterators.

This exercise will check your understanding of containers and iterators in the standard library.

Your goal will be to write a template my_find() function taking as input an iterator pointing to the beginning of a container, an iterator pointing to the end of a container and an element 'e' and returning an iterator to the first found element in the container equal to 'e' or an iterator to the end of the container if no elements were found.
Please create a file "utils.h". Write your function template function find() in this file.

To test your code, please create a file "test_container_iterator.cpp" and type into it the following code:
#include "utils.h"
#include <list>
#include <iostream>

int main()
{
 std::list<int> l;
 l.push_back(1); l.push_back(2);
 l.push_back(5); l.push_back(1);
 l.push_back(2);

 std::list<int>::iterator it;
 it = my_find(l.begin(), l.end(), 2);
 if (it != l.end()) std::cout << "found " << *it << std::endl;
}