What is the time complexity(O) of this function? I have mergesort and binary search in my code as well. I know binary search is O(log n) and mergesort is O(nlogn) but what is the complexity of this algorithm?
import os
mydatafile = open("myss.csv","w+")
def rec(searchpath):
if os.path.isdir(searchpath):
for i in os.listdir(searchpath):
childpath = os.path.join(searchpath,i)
if not os.path.isdir(childpath):
mydata = i + ", " + childpath + "\n"
mydatafile.write(mydata)
else:
mydata = i + ", " + childpath + "\n"
mydatafile.write(mydata)
rec(childpath)
rec("C:\Python27")
mydatafile.close()