human
Generate all rotations of a given string | Print all the rotated strings ..
Generate all rotations one by one and print.
Current index in str.
Current index in temp.
Copying the second part from the point of rotation ..
Copying the first part from the point of rotation ..
Driver Code"
Solution in Python:
assistant
#Here is code to generate all rotations of a given string and the other steps required.
 def printRotatedString ( str ) :
	lenn = len ( str )
	temp = [ 0 ] * ( lenn )
	for i in range ( lenn ) :
j = i
k = 0
	while ( j < len ( str ) ) :
		temp [ k ] = str [ j ]
		k += 1
		j += 1
	j = 0
	while ( j < i ) :
		temp [ k ] = str [ j ]
		j += 1
		k += 1
	print ( * temp , sep = " " )
if __name__ == ' _ _ main _ _ ' :
	str = " geeks "
	printRotatedString ( str )