for in range( )print(icombo("help" ) ['' [' '' '' '' ' ['he''hl''hp''el''ep''lp' ['hel''hep''hlp''elp' ['help' [finallysubset is just fixed-length permutationsorder mattersso the result is larger than for combo in factcalling subset with the length of the sequence is identical to permutesubset([ ] [[ ][ ][ ][ ][ ][ ]subset('abc' ['abc''acb''bac''bca''cab''cba'for in range( )print(isubset("help" ) ['' [' '' '' '' ' ['he''hl''hp''eh''el''ep''lh''le''lp''ph''pe''pl' ['hel''hep''hle''hlp''hpe''hpl''ehl''ehp''elh''elp''eph''epl''lhe''lhp''leh''lep''lph''lpe''phe''phl''peh''pel''plh''ple' ['help''hepl''hlep''hlpe''hpel''hple''ehlp''ehpl''elhp''elph''ephl''eplh''lhep''lhpe''lehp''leph''lphe''lpeh''phel''phle''pehl''pelh''plhe''pleh' ['help''hepl''hlep''hlpe''hpel''hple''ehlp''ehpl''elhp''elph''ephl''eplh''lhep''lhpe''lehp''leph''lphe''lpeh''phel''phle''pehl''pelh''plhe''pleh'these are some fairly dense algorithms (and franklymay seem to require zen-like "moment of clarityto grasp completely)but they are not too obscure if you trace through few simple cases first they're also representative of the sort of operation that requires custom data structure code--unlike the last stop on our data structures tour in the next section reversing and sorting sequences the permutation utilities of the prior section are useful in variety of applicationsbut there are even more fundamental operations that might seem prime candidates for automation reversing and sorting collections of valuesfor exampleare core operations in broad range of programs to demonstrate coding techniquesand to provide examples that yield closure for recurring theme of this let' take quick look at both of these in turn reversing and sorting sequences