In all the classes for this assignment, use of the following Python language features is mandatory:
Properties
Slots
Name implementation details (e.g. private data members) accordingly
Write one or more classes that define a red black tree which can be used with the following main function.
import random
import sys
def main( ):
if len(sys.argv) < 2:
print('Please provide the number of keys to enter.')
sys.exit(1)
s = int(sys.argv[1])
parts = int(s/3)
t = RBTree( )
r = list(range(1,s+1))
print('Randomly inserting the numbers from 1 to {}.'.format(len(r)))
random.shuffle(r)
for i in r:
print('inserted {}'.format(i))
t.insert(i)
f = open('a.dot', 'w')
writeRBTree(t, f)
f.flush( )
f.close( )
random.shuffle(r)