Linked List
Linked List
class LinkedList
{
private:
Node *head;
public:
LinkedList() : head(nullptr) {}
if (head->data == value)
{
Node *temp = head;
head = head->next;
delete temp;
return;
}
if (current)
{
previous->next = current->next;
delete current;
}
}
int main()
{
LinkedList list;
list.insert(10);
list.insert(20);
list.insert(30);
list.insert(40);
list.insert(49);
// list.remove(20);
// cout << "After removing 20: ";
// list.display();
list.sum();
cout << "The even no in linked List " << list.countEven() << endl;
return 0;
}