




'''simple docstring'''







from __future__ import annotations





def 		snake_case_							(_a			:							list[int | str]  ):
    create_state_space_tree(_a					,     []					,     0					,     [0 for i in range(len(_a  )  )]  )





def 		snake_case_							(_a			:							list[int | str]					,     _a			:							list[int | str]					,     _a			:							int					,     _a			:							list[int]					,     ):

    if index == len(_a  ):
        print(_a  )
        return

    for i in range(len(_a  )  ):
        if not index_used[i]:
            current_sequence.append(sequence[i]  )
            UpperCAmelCase     =	True
            create_state_space_tree(_a					,     _a					,     index + 1					,     _a  )
            current_sequence.pop()
            UpperCAmelCase     =	False
A     :   Optional[int]									=[3, 1, 2, 4]
generate_all_permutations(sequence)

A     :   Optional[int]									=['A', 'B', 'C']







generate_all_permutations(sequence_a)










'''simple docstring'''







from typing import Any


class     _a						:
       def __init__(			self		:			int     ,       lowercase		:			Any       ):



           '''simple docstring'''

           UpperCAmelCase     =	data
           UpperCAmelCase     =	None






class     _a						:
       def __init__(			self		:			int       ):



           '''simple docstring'''

           UpperCAmelCase     =	None
       def 					A   (			self		:			int       ):



           '''simple docstring'''

           UpperCAmelCase     =	self.head
           while temp is not None:
               print(temp.data     ,       end=''' '''       )
               UpperCAmelCase     =	temp.next
           print()
       def 					A   (			self		:			List[str]     ,       lowercase		:			Any       ):



           '''simple docstring'''

           UpperCAmelCase     =	Node(lowercase       )
           UpperCAmelCase     =	self.head
           UpperCAmelCase     =	new_node







       def 					A   (			self		:			List[Any]     ,       lowercase		:			List[Any]     ,       lowercase		:			str       ):



           '''simple docstring'''

           if node_data_a == node_data_a:
               return
           else:
               UpperCAmelCase     =	self.head
               while node_a is not None and node_a.data != node_data_a:
                   UpperCAmelCase     =	node_a.next

               UpperCAmelCase     =	self.head
               while node_a is not None and node_a.data != node_data_a:
                   UpperCAmelCase     =	node_a.next

               if node_a is None or node_a is None:
                   return

               UpperCAmelCase ,  UpperCAmelCase     =	node_a.data, node_a.data


if __name__ == "__main__":
   A									=LinkedList()
   for i in range(5, 0, -1):
      ll.push(i)

   ll.print_list()

   ll.swap_nodes(1, 4)
   print('After swapping')
   ll.print_list()




