Skip to main content

TRI Coding Challenge.

Project description

TRI Coding Challenge Parser
==========================

Parser Instructions
----------------------
To run parser, `python3 run_parser.py`.
Enter the path of your file `Enter the absolute path of input file:`
Enter the x-largest `Enter value for X-largest:`

Algorithmic Complexity
----------------------
- The parser reads in the document file line by line.
- O(n) * [file I/O]
- Note: scan_document(file_path) is modular to be replaced with more optimal scanning performane.
- An example of faster scanning solution: read file in chunks(1024) or chunks depending on size of file.
- The parser keeps the parsed data in a max-Heap.
- Returning the x-largest values from the max-Heap (delete-max) is O(log n).
- The space complexity of a heap is O(n).

Unit Test Suite
----------------------
To run unit tests `python3 setup.py test`

Hours Spent
----------------------
- I took 1-2 hours to write the parser, 2-4 hours on trying different unit test tools and structure.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

parser_shenghui-0.1.0.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

parser_shenghui-0.1.0-py3.6.egg (11.7 kB view details)

Uploaded Egg

File details

Details for the file parser_shenghui-0.1.0.tar.gz.

File metadata

File hashes

Hashes for parser_shenghui-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c6ec84fd6c340ba10a96880037a8edd3b10bf3df49ab3a07c40f8a1e5be62308
MD5 9ef9eb43e9f96391552caabd0e3da48c
BLAKE2b-256 34a5cb59ce6c7fc8de850f257fe19a30b4d8678ee0467635a86c2e4ddf7c4274

See more details on using hashes here.

File details

Details for the file parser_shenghui-0.1.0-py3.6.egg.

File metadata

File hashes

Hashes for parser_shenghui-0.1.0-py3.6.egg
Algorithm Hash digest
SHA256 a0af0208f92ca3b1a10433f2669728bbcbde940dfbde5a8027e5acb44dbfa7f1
MD5 7de8a79060c87f641dc8c2029f87865a
BLAKE2b-256 36f45c96f0405f5e3b4178db2536b2a42dced0480ad581b8668e0db2fe68d9b3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page