human
Reverse the Words of a String using Stack | function to reverse the words of the given string without using strtok ( ) ..
create an empty string stack.
create an empty temporary string.
traversing the entire string.
push the temporary variable into the stack.
assigning temporary variable as empty.
for the last word of the string.
Get the words in reverse order.
Driver code"
Solution in Python:
 Give me a code to reverse the Words of a String using Stack and the other steps required?
assistant
#Here is code to reverse the Words of a String using Stack and the other steps required.
 def reverse ( s ) :
	stc = [ ]
	temp = " "
	for i in range ( len ( s ) ) :
		if s [ i ] == ' ▁ ' :
		stc . append ( temp )
		temp = " "
		else :
		temp = temp + s [ i ]
	stc . append ( temp )
	while len ( stc ) != 0 :
		temp = stc [ len ( stc ) - 1 ]
		print ( temp , end = " ▁ " )
		stc . pop ( )
	print ( )
s = " I ▁ Love ▁ To ▁ Code "
reverse ( s )