Implementing python list and Binary search tree -
Implementing python list and Binary search tree -
i working on making index text file. index list of every word , symbols like(~!@#$%^&*()_-{}:"<>?/.,';[]1234567890|) , counting number of times each token occurred in text file. printing in ascending ascii value order.
i going read .txt file , split words , special characters , store in list. can 1 throw me thought on how utilize binary search in case.
if lookup little (say, 1000 records), can utilize dict; can either pickle()
it, or write out text file. overhead (for size) little anyway.
if look-up table bigger, or there little number of lookups per run, suggest using key/value database (e.g. dbm).
if complex utilize dbm, utilize sql (e.g. sqlite3, mysql, postgres) or nosql database. depending on application, can huge benefit features these provide.
in either case, hard work done you, much improve can expect yourself. these formats standard, simple-to-use tools read data.
python python-3.x
Comments
Post a Comment