I have a sorted list in java, i just want to split this list into sublists based on the first alphabet at each index of list. For example
List contains
You could use Java 8 Streams. Unfortunately, this method doesn't take advantage from the list being sorted already. list has to be the list containing your elements.