Skip to content

Commit 2227403

Browse files
author
Roy
committed
Adding more comments
1 parent 8e21cdb commit 2227403

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎src/com/interview/string/LexicographicRankInPermutation.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
public class LexicographicRankInPermutation {
44

5+
//you can create a AVL tree to efficiently find total
6+
//number of smaller characters.
7+
//You can keep size of subtree at root and keep moving left or right
8+
//depending on the character you looking for
59
private int findNumberOfSmallerCharactersOnRight(int index,char []str){
610
int count=0;
711
for(int i=index+1; i < str.length; i++){

0 commit comments

Comments
 (0)