#include using namespace std; //class template template class List{ private: T* list; // Dynamic array to store the list elements int capacity; // Maximum capacity of the list int length; // Current number of elements in the list void resize(){ // Resize the array to double its current size T* newList = new T[capacity * 2]; for(int i=0;i length) return; if(length >= capacity) resize(); for(int i=length;i>=position;i--){ list[i+1] = list[i]; } list[position] = value; length++; } // Delete an element by its value (first occurrence) bool deleteByValue(T value){ int index = search(value); return deleteByPosition(index); } // Delete an element by its position (0-based index) bool deleteByPosition(int position){ if(position > length) return false; else{ for(int i=position;i list; list.insert(0, 10); list.insert(0, 13); list.insert(0, 11); list.insert(0, 16); list.display(); return 0; }