Subsequences generated by including characters or ASCII value of characters of given string | Function to print subsequences containing ASCII value of the characters or the the characters of the given string ; Base Case ; If length of the subsequence exceeds 0 ; Print the subsequence ; Stores character present at i - th index of str ; If the i - th character is not included in the subsequence ; Including the i - th character in the subsequence ; Include the ASCII value of the ith character in the subsequence ; Driver Code ; Stores length of str
function FindSub ( str , res , i ) { if ( i === str . length ) { if ( res . length > 0 ) { document . write ( res + " " ) ; } return ; } var ch = str [ i ] ; FindSub ( str , res , i + 1 ) ; FindSub ( str , res + ch , i + 1 ) ; FindSub ( str , res + ch . charCodeAt ( 0 ) , i + 1 ) ; } var str = " " ; var res = " " ; var N = str . length ; FindSub ( str , res , 0 ) ;