union_find_tree 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +26 -2
- data/lib/union_find_tree/version.rb +1 -1
- data/union_find_tree.gemspec +1 -1
- data/wercker.yml +27 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e64ce0df47e7478e84825ba639d1ed6ff8e1d88
|
4
|
+
data.tar.gz: fbe934f0321ee5fec474351fb048ccb0fc88b3e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43ea5aa997412d6b2630dd00638e814280b7ff54fb418ebabaf43ae37649312829ecf82c1a480a927719b500105fe1531ccb6d006175dff3a1839d6ec4700ac1
|
7
|
+
data.tar.gz: b05faa03b50b6b6cc2d76514e9f1e16bcab5c0ef627079b4a41420be90aee58022871d55d7b31110f7a668e02f1c1cc2e9493285247665704c7697d80eaf54e0
|
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
[](https://app.wercker.com/project/byKey/71ca0846f5e839b6841e1f44cf3cfb15)
|
2
|
+
|
1
3
|
# UnionFindTree
|
2
4
|
|
3
5
|
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/union_find_tree`. To experiment with that code, run `bin/console` for an interactive prompt.
|
@@ -21,6 +23,10 @@ Or install it yourself as:
|
|
21
23
|
$ gem install union_find_tree
|
22
24
|
|
23
25
|
## Usage
|
26
|
+
This tree's data size is dynamic variable.
|
27
|
+
If you want to use this library to programming contests, you can copy and paste from lib/union_find_tree.rb
|
28
|
+
|
29
|
+
example1
|
24
30
|
```ruby
|
25
31
|
require 'union_find_tree'
|
26
32
|
include UnionFindTree
|
@@ -33,8 +39,26 @@ tree.size(1) #=> 2
|
|
33
39
|
tree.size(3) #=> 1
|
34
40
|
|
35
41
|
```
|
36
|
-
|
37
|
-
|
42
|
+
|
43
|
+
you can add any object.
|
44
|
+
|
45
|
+
example2
|
46
|
+
```ruby
|
47
|
+
require 'union_find_tree'
|
48
|
+
include UnionFindTree
|
49
|
+
|
50
|
+
tree = UnionFind.new
|
51
|
+
o1 = Array.new(1)
|
52
|
+
o2 = Array.new(2)
|
53
|
+
o3 = Array.new(3)
|
54
|
+
tree.unite(o1,o2)
|
55
|
+
tree.same?(o1,o2) #=> true
|
56
|
+
tree.same?(o1,o3) #=> false
|
57
|
+
tree.size(o1) #=> 2
|
58
|
+
tree.size(o3) #=> 1
|
59
|
+
|
60
|
+
```
|
61
|
+
|
38
62
|
|
39
63
|
## Development
|
40
64
|
|
data/union_find_tree.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["hayabusatoshihumi@gmail.com"]
|
11
11
|
|
12
12
|
spec.summary = %q{ This is a union_find_tree library. }
|
13
|
-
spec.description = %q{ This is a
|
13
|
+
spec.description = %q{ This is a union_find_tree library. It is used for connecting and grouping items. you can connect any object}
|
14
14
|
spec.homepage = "https://github.com/getty104/UnionFIndTree"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
data/wercker.yml
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# This references the default Ruby container from
|
2
|
+
# the Docker Hub.
|
3
|
+
# https://registry.hub.docker.com/_/ruby/
|
4
|
+
# If you want to use a specific version you would use a tag:
|
5
|
+
# ruby:2.2.2
|
6
|
+
box: ruby
|
7
|
+
# You can also use services such as databases. Read more on our dev center:
|
8
|
+
# http://devcenter.wercker.com/docs/services/index.html
|
9
|
+
# services:
|
10
|
+
# - postgres
|
11
|
+
# http://devcenter.wercker.com/docs/services/postgresql.html
|
12
|
+
|
13
|
+
# - mongo
|
14
|
+
# http://devcenter.wercker.com/docs/services/mongodb.html
|
15
|
+
|
16
|
+
# This is the build pipeline. Pipelines are the core of wercker
|
17
|
+
# Read more about pipelines on our dev center
|
18
|
+
# http://devcenter.wercker.com/docs/pipelines/index.html
|
19
|
+
build:
|
20
|
+
# Steps make up the actions in your pipeline
|
21
|
+
# Read more about steps on our dev center:
|
22
|
+
# http://devcenter.wercker.com/docs/steps/index.html
|
23
|
+
steps:
|
24
|
+
- bundle-install
|
25
|
+
- script:
|
26
|
+
name: rspec
|
27
|
+
code: bundle exec rspec
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: union_find_tree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- getty104
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,8 +52,8 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
|
-
description: " This is a
|
56
|
-
items."
|
55
|
+
description: " This is a union_find_tree library. It is used for connecting and grouping
|
56
|
+
items. you can connect any object"
|
57
57
|
email:
|
58
58
|
- hayabusatoshihumi@gmail.com
|
59
59
|
executables: []
|
@@ -73,6 +73,7 @@ files:
|
|
73
73
|
- lib/union_find_tree.rb
|
74
74
|
- lib/union_find_tree/version.rb
|
75
75
|
- union_find_tree.gemspec
|
76
|
+
- wercker.yml
|
76
77
|
homepage: https://github.com/getty104/UnionFIndTree
|
77
78
|
licenses:
|
78
79
|
- MIT
|