Driver Code
int main ( ) { node * ptr = NULL ; node * head = newnode ( " geeks " ) ; head -> next = newnode ( " geeks " ) ; head -> next -> next = newnode ( " abcd " ) ; head -> next -> next -> next = newnode ( " game " ) ; head -> next -> next -> next -> next = newnode ( " game " ) ; head -> next -> next -> next -> next -> next = newnode ( " knight " ) ; head -> next -> next -> next -> next -> next -> next = newnode ( " harry " ) ; head -> next -> next -> next -> next -> next -> next -> next = newnode ( " geeks " ) ; cout << Majority_in_linklist ( head ) << endl ; return 0 ; }