This library contains useful data structures and algorithms that are commonly used in coding interviews.
Project description
Description
This library contains useful data structures and algorithms that are commonly used in coding interviews. The goal of this project is to provide modules that can actually be used to solve interviewing problems. This project is NOT a code dump of solutions to interviewing problems. The classes and functions were designed to be compatible with LeetCode.
Installation
The pyinterview
package can be installed directly using pip
.
pip install pyinterview
Usage
Users can import common data structures and algorithms from several different modules. For example:
- To manually construct a binary tree, import the
TreeNode
class from thetrees
module:
from pyinterview.trees import TreeNode
root = TreeNode(2)
root.left = TreeNode(1)
root.right = TreeNode(3)
- To construct a undirected graph adjacency list, import the
undirected_adj_list
function from thegraphs
module:
from pyinterview.graphs import undirected_adj_list
edges = [('A', 'B'), ('A', 'C'), ('C', 'D')]
adj_list = undirected_adj_list(edges)
Documentation
The documentation is a work in progress, but contributions are welcome!
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
Built Distribution
File details
Details for the file pyinterview-0.1.5.tar.gz
.
File metadata
- Download URL: pyinterview-0.1.5.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b44c41052226106315b139013186e5aed855b2f6554d97a24314566dca09701a |
|
MD5 | 79c3b65e10f820f8708eabf53b0bca8e |
|
BLAKE2b-256 | a01d021612ffd376564eda8546205a316f306dea6718858e1e028e45d2957e23 |
File details
Details for the file pyinterview-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: pyinterview-0.1.5-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 107ca44eda619ceb397ca7e9c4a707383cd1d728c173b2fe508ddae850048a13 |
|
MD5 | 2bf8076ece33e07a42c3128eba16c351 |
|
BLAKE2b-256 | d4911f99e12601540ebc71d23ee7faf75f4aeffb86c03434c631be6c6b1fbec5 |