'''simple docstring'''


from random import randint
from tempfile import TemporaryFile

import numpy as np


def  _lowerCamelCase   (				lowerCamelCase_ :							str     ,					lowerCamelCase_ :							List[str]     ,					lowerCamelCase_ :							int       ):



     """simple docstring"""





     UpperCAmelCase_							:       Optional[int]       =				0
     if start < end:
          UpperCAmelCase_							:       Optional[int]       =				randint(lowerCamelCase_     ,					lowerCamelCase_       )
          UpperCAmelCase_							:       List[str]       =				a[end]
          UpperCAmelCase_							:       str       =				a[pivot]
          UpperCAmelCase_							:       List[Any]       =				temp

          UpperCAmelCase_       ,      UpperCAmelCase_							:       List[Any]       =				_in_place_partition(lowerCamelCase_     ,					lowerCamelCase_     ,					lowerCamelCase_       )
          count += _in_place_quick_sort(lowerCamelCase_     ,					lowerCamelCase_     ,					p - 1       )
          count += _in_place_quick_sort(lowerCamelCase_     ,					p + 1     ,					lowerCamelCase_       )
     return count


def  _lowerCamelCase   (				lowerCamelCase_ :							Dict     ,					lowerCamelCase_ :							Union[str, Any]     ,					lowerCamelCase_ :							str       ):



     """simple docstring"""





     UpperCAmelCase_							:       str       =				0
     UpperCAmelCase_							:       Optional[int]       =				randint(lowerCamelCase_     ,					lowerCamelCase_       )
     UpperCAmelCase_							:       int       =				a[end]
     UpperCAmelCase_							:       str       =				a[pivot]
     UpperCAmelCase_							:       Dict       =				temp
     UpperCAmelCase_							:       List[Any]       =				start - 1
     for index in range(lowerCamelCase_     ,					lowerCamelCase_       ):
          count += 1
          if a[index] < a[end]:  # check if current val is less than pivot value
               UpperCAmelCase_							:       int       =				new_pivot_index + 1
               UpperCAmelCase_							:       List[Any]       =				a[new_pivot_index]
               UpperCAmelCase_							:       List[Any]       =				a[index]
               UpperCAmelCase_							:       Optional[int]       =				temp

     UpperCAmelCase_							:       int       =				a[new_pivot_index + 1]
     UpperCAmelCase_							:       Any       =				a[end]
     UpperCAmelCase_							:       List[Any]       =				temp
     return new_pivot_index + 1, count


snake_case__					:      Optional[int]				      =  TemporaryFile()
snake_case__					:      Any				      =  100  # 1000 elements are to be sorted


snake_case__      ,				snake_case__					:      Union[str, Any]				      =  0, 1  # mean and standard deviation
snake_case__					:      Tuple				      =  np.random.normal(mu, sigma, p)
np.save(outfile, X)
print('''The array is''')
print(X)


outfile.seek(0)  # using the same array
snake_case__					:      str				      =  np.load(outfile)
snake_case__					:      Optional[Any]				      =  len(M) - 1
snake_case__					:      Union[str, Any]				      =  _in_place_quick_sort(M, 0, r)

print(
    '''No of Comparisons for 100 elements selected from a standard normal distribution'''
    '''is :'''
)





print(z)







'''simple docstring'''


def  _lowerCamelCase   (				lowerCamelCase_ :							int     ,					lowerCamelCase_ :							int       ):



     """simple docstring"""





     return int(input_a == input_a == 0       )


def  _lowerCamelCase   (				):



     """simple docstring"""





     print('Truth Table of NOR Gate:'       )
     print('|   Input 1   |  Input 2  | Output |'       )
     print(F'''|      0      |    0      |  {nor_gate(0     ,					0       )}     |'''       )
     print(F'''|      0      |    1      |  {nor_gate(0     ,					1       )}     |'''       )
     print(F'''|      1      |    0      |  {nor_gate(1     ,					0       )}     |'''       )
     print(F'''|      1      |    1      |  {nor_gate(1     ,					1       )}     |'''       )


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 main()






