Created
June 16, 2021 17:26
-
-
Save PearlMiglani/1927e075f929a920efb8b768824c872f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stream=[1,2,3,4,5,6,4,2,5,9,1,6,3,7,1,2,2,4,2,1] | |
print('Using conventional Algorithm:') | |
start_time = time.time() | |
st_unique=[] | |
for i in stream: | |
if i in st_unique: | |
continue | |
else: | |
st_unique.append(i) | |
print('distinct elements',len(st_unique)) | |
print("--- %s seconds ---" % (time.time() - start_time)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment