Skip to content

Commit

Permalink
README update, redundant dependencies cleanup, make it more py2-py3 c…
Browse files Browse the repository at this point in the history
…ompatible (going to remove py2 support at all)
  • Loading branch information
prawn-cake committed Feb 10, 2017
1 parent b5e6043 commit ea48cb5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ I recommend try to find mature implementations, but in case you need to customiz
my implementation is a good start to customize it for your needs.


## Data structure implementations
## Data structures implemented

* Binary search tree
* Binary heap
Expand All @@ -26,10 +26,16 @@ my implementation is a good start to customize it for your needs.
* dijkstra search
* bfs
* [BK-Tree](https://en.wikipedia.org/wiki/BK-tree)
* [Prefix tree] (https://en.wikipedia.org/wiki/Trie)
* [Prefix tree](https://en.wikipedia.org/wiki/Trie)

## Links

* [List of algorithms](https://en.wikipedia.org/wiki/List_of_algorithms)
* [List of data structures](https://en.wikipedia.org/wiki/List_of_data_structures)
* [Google Technical Development Guide](https://www.google.com/about/careers/students/guide-to-technical-development.html)

## Tests
`tox`

tox


6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

setup(
name='data_structures',
version='0.1.0',
packages=['structures', 'structures.tests'],
version='0.1.1',
packages=['structures'],
url='https://github.com/prawn-cake/data_structures',
license='MIT',
author='Maksim Ekimovskii',
author_email='ekimovsky.maksim@gmail.com',
description='Pure python data structures implementations'
description='Various data structures implementations in pure python'
)
12 changes: 3 additions & 9 deletions structures/binary_heap.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
# -*- coding: utf-8 -*-
import abc


class BinaryHeap(object):

__metaclass__ = abc.ABCMeta

def __init__(self, values=None):
self._storage = values or []

@property
def storage(self):
return self._storage

@abc.abstractmethod
def insert(self, k):
pass
raise NotImplementedError()

@classmethod
def heapify(cls, values):
Expand All @@ -24,13 +20,11 @@ def heapify(cls, values):
heap.insert(k)
return heap

@abc.abstractmethod
def remove(self, k):
pass
raise NotImplementedError()

@abc.abstractmethod
def extract_min(self):
pass
raise NotImplementedError()

def swap(self, i, j):
swap = self.storage[i]
Expand Down

0 comments on commit ea48cb5

Please sign in to comment.