Skip to content
项目

关于

Solutions for Interview questions appearing in the 6th edition of Cracking the Coding Interview (CTCI)

学习与教育

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
0
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

Cracking the Coding Interview (6th edition) Python Solutions

Existing Python solutions can be found officially here and user-created here

Current progress

| Nr. | Chapter | Done | Total | Ommited | Notes | |:---: |:----------------------: |:----: |:-----: |:-------: | :-------: | | 1 | Array and String | 9 | 9 | | | | | 2 | Linked Lists | 8 | 8 | | | | 3 | Stacks and Queues | 6 | 6 | 1 | | | 4 | Trees and Graphs | 12 | 12 | | | | 5 | Bit Manipulation | 8 | 8 | | | | 6 | Math and Logic Puzzles | 10 | 10 | 4 | | | 7 | OO Design | 0 | 12 | | | | 8 | Recursion and DP | 14 | 14 | | | | 9 | System Design | 0 | 8 | | See the System Design Primer | | 10 | Sorting and Searching | 9 | 11 | 1 | | | 11 | Testing | 4 | 6 | 4 | | | 12 | C/C++ | 11 | 11 | 11 | | | 13 | Java | 0 | 8 | | | | 14 | Databases | 0 | 7 | | | | 15 | Threads and Locks | 0 | 7 | | | | 16 | Moderate | 26 | 26 | 1 | | | 17 | Hard | 26 | 26 | | |

Running the solutions

For convenience, the project has a setup.py that specifies a package, for local path resolving.
This can be installed locally in the python (virtual)environment by using:

pip install -e .

Problems can be run by running the file, most should have a main method with some sample input, e.g. :

python p16_20.py

Some highlights

Langton's ant (Chapter 16, Problem 22)

Result pattern

An interesting example of emergent patterns from simple rules. Raise the number of iterations in the code to see more of the "highway" form.
For more information, check the wikipedia link.

Tree visualising in VS Code

Example tree

This requires graphviz to be installed locally and the extension added to VS Code.
The one used in the screenshot above can be found here.

探索相关项目

加载中…