#include using namespace std; template class Node{ T data; Node* next; public: Node(T data, Node* next) : data(data), next(next){} }; template class LinkedList{ Node* head; int size; public: LinkedList(T data){ Node node(data, nullptr); head = &node; size = 1; } bool insertAtPosition(int position, T data){ Node newNode(data, head); for(int i=0;inext; } Node temp = newNode->next; newNode = newNode->next; temp->next = newNode; size++; } void printList(){ Node temp = *head; for(int i=0;inext; } } }; int main(){ LinkedList list(1); list.insertAtPosition(0, 1); return 0; }