
'''simple docstring'''






import random







def 		A_       (	_lowerCAmelCase   :    int				,	_lowerCAmelCase   :    float				,	_lowerCAmelCase   :    bool = False							):



      """simple docstring"""




      _lowerCamelCase				:   dict								=   {i: [] for i in range(_lowerCAmelCase							)}

      # if probability is greater or equal than 1, then generate a complete graph
      if probability >= 1:
            return complete_graph(_lowerCAmelCase							)
      # if probability is lower or equal than 0, then return a graph without edges
      if probability <= 0:
            return graph

      # for each couple of nodes, add an edge from u to v
      # if the number randomly generated is greater than probability probability
      for i in range(_lowerCAmelCase							):
            for j in range(i + 1				,	_lowerCAmelCase							):
                  if random.random() < probability:
                        graph[i].append(_lowerCAmelCase							)
                        if not directed:
                              # if the graph is undirected, add an edge in from j to i, either
                              graph[j].append(_lowerCAmelCase							)
      return graph







def 		A_       (	_lowerCAmelCase   :    int							):



      """simple docstring"""




      return {
          i: [j for j in range(_lowerCAmelCase							) if i != j] for i in range(_lowerCAmelCase							)
      }


if __name__ == "__main__":
 import doctest

 doctest.testmod()

'''simple docstring'''






from __future__ import annotations

from collections.abc import Iterable, Iterator
from dataclasses import dataclass

UpperCAmelCase_       :   str   =       (3, 9, -11, 0, 7, 5, 1, -1)
UpperCAmelCase_       :   int   =       (4, 6, 2, 0, 8, 10, 3, -2)

@dataclass
class  UpperCAmelCase__						:
    lowerCAmelCase_				    =		42
    lowerCAmelCase_				    =		42


class  UpperCAmelCase__						:



    def __init__(	self      :       Optional[int],__A      :       Iterable[int]     ):
          _lowerCamelCase				:   Node | None								=   None
          for i in sorted(__A,reverse=__A     ):
                _lowerCamelCase				:   Dict								=   Node(__A,self.head     )



    def __iter__(	self      :       str     ):
          _lowerCamelCase				:   Dict								=   self.head
          while node:
                yield node.data
                _lowerCamelCase				:   Optional[Any]								=   node.next_node



    def __len__(	self      :       str     ):
          return sum(1 for _ in self     )



    def __str__(	self      :       str     ):
          return " -> ".join([str(__A     ) for node in self]     )







def 		A_       (	_lowerCAmelCase   :    SortedLinkedList				,	_lowerCAmelCase   :    SortedLinkedList							):



      """simple docstring"""




      return SortedLinkedList(list(_lowerCAmelCase							) + list(_lowerCAmelCase							)							)


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 UpperCAmelCase_       :   List[str]   =       SortedLinkedList
 print(merge_lists(SSL(test_data_odd), SSL(test_data_even)))