Skip to content

zh-plus/Code_Library_Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hao Zheng's Algorithm Code Library.

The very first reason I start this repo is preparing for google's SWE interview using Python. But in order to keep my Java skills warm, I'll maintain a Java version of Code Library in there. As a CS major student, I will try my best to make my implementation elegant in both of them.

Currently, there's Codeforces and CodeJam waiting for me.

Codeforces

Well known OJ platform.

Tips:

In order to pass the time-limited Codeforces tests, I recommend PyPy 3.5 (6.0.0) as interpreter, which is several times faster than origin Python interpreter nowadays(2018.12).

CodeJam

Google OJ questions. All the questions resolved currently can be retrieved on Kick Start

The input of almost all the questions is file, thus I reload the input as input = lambda: input_file.readline().rstrip('\n'). However, the print is not reloaded since I want to see the output in the console.

There'll be other OJ involved in the future.

template:

The python implementation of some common algorithms. Most of them originate from the sudo code of Introduction to Algorithms, Third Edition

In order to illustrate their performance intuitively, there will be a comparison between my implementation and python implementation.

By the way, the Timer class from template/tool_kit.py is quite convenient for me. It is worth encasing your code into Timer

with Timer():
    # your code

instead of

start = perf_counter()
# your code
print(perf_counter() - start, 's')

About

Elegant code library --- Python.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages