Given a linked list of characters. The task is to find the maximum occurring character in the linked list. if their are multiple answer return the first maximum occurring character.
Input : g -> e -> e -> k -> s Output : e Input : a -> a -> b -> b -> c -> c -> d -> d Output : d
Iteratively count the frequency of each character in a string and return the one which has maximum occurrence.
Method 2: (use count array)
Create a count array and count each character frequency return the maximum occurring character.
- Construct a Maximum Sum Linked List out of two Sorted Linked Lists having some Common nodes
- Count substrings with each character occurring at most k times
- Check if max occurring character of one string appears same no. of times in other
- Maximum sum of K consecutive nodes in the given Linked List
- Minimum and Maximum Prime Numbers of a Singly Linked List
- Maximum and Minimum element of a linked list which is divisible by a given number k
- Find minimum and maximum elements in singly Circular Linked List
- Create new linked list from two given linked list with greater element at each node
- Difference between Singly linked list and Doubly linked list
- Merge a linked list into another linked list at alternate positions
- XOR Linked List - A Memory Efficient Doubly Linked List | Set 1
- XOR Linked List – A Memory Efficient Doubly Linked List | Set 2
- Convert singly linked list into circular linked list
- Check if a linked list is Circular Linked List
- Convert Singly Linked List to XOR Linked List
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.