#include using namespace std; template class Node{ public: T data; Node* next; Node(T data, Node* next) : data(data), next(next){} }; template class LinkedList{ Node* head; public: LinkedList(T data){ Node node(data, nullptr); head = &node; } 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; return true; } void printList(){ Node* temp = head; while(temp != nullptr){ cout<data; temp = temp->next; } } }; int main(){ LinkedList list(1); list.insertAtPosition(0, 1); list.printList(); return 0; }