data_structures_101 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/data_structures_101/hash/base_hash_table.rb +5 -5
- data/lib/data_structures_101/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7fb91f6158a358309e3a072704afe54e6c1b090
|
4
|
+
data.tar.gz: 8e4bc2cbc54300101e3333853e229a21d889c649
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fcba7fd2564eb6ade7cb8fb8a9409a4a88e67287f1377bdb6edfd6514c56ecfb8cd1b8c16a8bac1b026cd6a96cd4a2e593479e74618a533eb8d0e27cd79af8d
|
7
|
+
data.tar.gz: 5fd3fc1ea446f8b1c2da7a18b0ed87e023baef177f4d4862510fa859418babf90509d90669f8984087eb2e6486a7dd448f6f006cbcd920d762879e9dfc090a6f
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# DataStructures101 [![Build Status](https://travis-ci.org/renehernandez/
|
1
|
+
# DataStructures101 [![Build Status](https://travis-ci.org/renehernandez/data_structures_101.svg?branch=master)](https://travis-ci.org/renehernandez/bok-data_structures_101) [![Gem Version](https://badge.fury.io/rb/data_structures_101.svg)](https://badge.fury.io/rb/data_structures_101)
|
2
2
|
|
3
3
|
DataStructures101 is a simple gem that groups several implementations of common data structures usually taught in Computer Science courses. The overall goal of the gem is to provide easy to use functionality (trying to match the behavior of existent structures in Ruby) while providing the user with a framework to test and compare their implementations against.
|
4
4
|
|
@@ -32,7 +32,7 @@ To create a LinkedList
|
|
32
32
|
list = DataStructures101::LinkedList.new
|
33
33
|
```
|
34
34
|
|
35
|
-
For more information in the `LinkedList` class, check [this post](https://bitsofknowledge.net/data-structures-101-
|
35
|
+
For more information in the `LinkedList` class, check [this post](https://bitsofknowledge.net/2017/08/05/data-structures-101-linkedlist-implementation) and read the documentation.
|
36
36
|
|
37
37
|
## Contributing
|
38
38
|
|
@@ -52,16 +52,16 @@ module DataStructures101
|
|
52
52
|
|
53
53
|
private
|
54
54
|
|
55
|
-
def new_capacity
|
56
|
-
2 * capacity - 1
|
55
|
+
def new_capacity
|
56
|
+
2 * @capacity - 1
|
57
57
|
end
|
58
58
|
|
59
|
-
def resize(
|
60
|
-
@capacity =
|
59
|
+
def resize(new_cap)
|
60
|
+
@capacity = new_cap
|
61
61
|
|
62
62
|
buffer = self.map { |key, value| [key, value] }
|
63
63
|
|
64
|
-
|
64
|
+
@table = Array.new(@capacity)
|
65
65
|
@size = 0
|
66
66
|
|
67
67
|
buffer.each { |key, value| self[key] = value }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: data_structures_101
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aegis
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|