Skip to main content

This library contains useful data structures and algorithms that are commonly used in coding interviews.

Project description

pyinterview logo

PyPI version PyPI - Downloads Build Status Code Style pre-commit Contributor Covenant Documentation Status GitHub

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 the trees 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 the graphs 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!

pyinterview documentation

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

pyinterview-0.1.5.tar.gz (8.0 kB view hashes)

Uploaded Source

Built Distribution

pyinterview-0.1.5-py3-none-any.whl (8.6 kB view hashes)

Uploaded Python 3

Supported by

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