int& List::operator[](int pos) const { Node* temp; temp = head; if(pos >= list_size) throw "Invalid array index"; while(pos-- > 0) temp = temp->getNext(); int value = temp->getData(); return value; } int List::size() const { return list_size; }