Given a linked list of characters. The task is to find the maximum occurring character in the linked list. if there are multiple answers, 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.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Find the maximum occurring character after performing the given operations
- 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
- NFA to accept strings that has atleast one character occurring in a multiple of 3
- XOR Linked List - A Memory Efficient Doubly Linked List | Set 1
- Merge a linked list into another linked list at alternate positions
- Check if a linked list is Circular Linked List
- Convert singly linked list into circular linked list
- Difference between Singly linked list and Doubly linked list
- Convert Singly Linked List to XOR Linked List
- Create new linked list from two given linked list with greater element at each node
- XOR Linked List – A Memory Efficient Doubly Linked List | Set 2
- Frequency of maximum occurring subsequence in given string
- Count of maximum occurring subsequence using only those characters whose indices are in GP
- Construct a Maximum Sum Linked List out of two Sorted Linked Lists having some Common nodes
- Find first non-repeating character in a given string using Linked List
- Find the sum of all highest occurring elements in an Array
- Sum of all even occurring element in an array
- Sum of all minimum occurring elements in an Array
- K most occurring strings
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.