Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit216e2e5

Browse files
authored
Update README.md
1 parent1873caf commit216e2e5

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

‎README.md‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ This is an incomplete list of arguments in favor of immutability:
2727
-[Dictionary (Associative Array)](https://en.wikipedia.org/wiki/Associative_array)
2828
-[Set](https://en.wikipedia.org/wiki/Set_(abstract_data_type))
2929
-[BinaryTree](https://en.wikipedia.org/wiki/Binary_tree)
30+
-[Heap](https://en.wikipedia.org/wiki/Heap_(data_structure))
3031

3132
##Upcoming:
3233
1. <strike> Queue </strike>
@@ -40,7 +41,7 @@ This is an incomplete list of arguments in favor of immutability:
4041
9. AVLTree
4142
10. BinarySearchTree
4243
11. RedBlackTree
43-
12. Heap
44+
12.<strike>Heap</strike>
4445
13. HashTable
4546
14. <strike>Dictionary (Associative Array)</strike>
4647
15. <strike>BinaryTree</strike>
@@ -117,6 +118,14 @@ tree = BinaryTree(BinaryTree(BinaryTree(None, None, 2),
117118
print tree,repr(tree),13in tree,3.14in tree,list(tree),iter(tree), tree.add(1).add(2).remove(3).remove(4)
118119
```
119120

121+
###Heap
122+
```python
123+
from immutable.trresimport Heap
124+
125+
h= Heap.make([1,2,3,4,5,6,10,14,11,0,-2),min)# second parameter is an optional comparator, default is max.
126+
print h.add(1).pop(3).pop(4).add(20).head()
127+
```
128+
120129
&nbsp;
121130
&nbsp;
122131
&nbsp;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp