Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
b
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
b
Commits
5c97c854
Commit
5c97c854
authored
Apr 13, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
43d424f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
15 deletions
+2
-15
all_test.go
all_test.go
+2
-15
No files found.
all_test.go
View file @
5c97c854
...
@@ -332,21 +332,13 @@ func TestSetGet0(t *testing.T) {
...
@@ -332,21 +332,13 @@ func TestSetGet0(t *testing.T) {
func
TestSetGet1
(
t
*
testing
.
T
)
{
func
TestSetGet1
(
t
*
testing
.
T
)
{
const
N
=
40000
const
N
=
40000
//const N = 21
//const N = 41
//const N = 320
//const N = 730
for
_
,
x
:=
range
[]
int
{
0
,
-
1
,
0x555555
,
0xaaaaaa
,
0x333333
,
0xcccccc
,
0x314159
}
{
for
_
,
x
:=
range
[]
int
{
0
,
-
1
,
0x555555
,
0xaaaaaa
,
0x333333
,
0xcccccc
,
0x314159
}
{
//for _, x := range []int{0x333333} {
//for _, x := range []int{0x314159} {
//for _, x := range []int{0} {
r
:=
TreeNew
(
cmp
)
r
:=
TreeNew
(
cmp
)
set
:=
r
.
Set
set
:=
r
.
Set
a
:=
make
([]
int
,
N
)
a
:=
make
([]
int
,
N
)
for
i
:=
range
a
{
for
i
:=
range
a
{
a
[
i
]
=
(
i
^
x
)
<<
1
a
[
i
]
=
(
i
^
x
)
<<
1
}
}
//dbg("", a)
for
i
,
k
:=
range
a
{
for
i
,
k
:=
range
a
{
set
(
k
,
k
^
x
)
set
(
k
,
k
^
x
)
if
g
,
e
:=
r
.
Len
(),
i
+
1
;
g
!=
e
{
if
g
,
e
:=
r
.
Len
(),
i
+
1
;
g
!=
e
{
...
@@ -614,9 +606,7 @@ func benchmarkGetRnd(b *testing.B, n int) {
...
@@ -614,9 +606,7 @@ func benchmarkGetRnd(b *testing.B, n int) {
func
TestSetGet2
(
t
*
testing
.
T
)
{
func
TestSetGet2
(
t
*
testing
.
T
)
{
const
N
=
40000
const
N
=
40000
//const N = 400
for
_
,
x
:=
range
[]
int
{
0
,
-
1
,
0x555555
,
0xaaaaaa
,
0x333333
,
0xcccccc
,
0x314159
}
{
for
_
,
x
:=
range
[]
int
{
0
,
-
1
,
0x555555
,
0xaaaaaa
,
0x333333
,
0xcccccc
,
0x314159
}
{
//for _, x := range []int{0} {
rng
:=
rng
()
rng
:=
rng
()
r
:=
TreeNew
(
cmp
)
r
:=
TreeNew
(
cmp
)
set
:=
r
.
Set
set
:=
r
.
Set
...
@@ -782,10 +772,8 @@ func TestDelete0(t *testing.T) {
...
@@ -782,10 +772,8 @@ func TestDelete0(t *testing.T) {
}
}
func
TestDelete1
(
t
*
testing
.
T
)
{
func
TestDelete1
(
t
*
testing
.
T
)
{
//const N = 130000
const
N
=
130000
const
N
=
40
for
_
,
x
:=
range
[]
int
{
0
,
-
1
,
0x555555
,
0xaaaaaa
,
0x333333
,
0xcccccc
,
0x314159
}
{
//for _, x := range []int{0, -1, 0x555555, 0xaaaaaa, 0x333333, 0xcccccc, 0x314159} {
for
_
,
x
:=
range
[]
int
{
0
}
{
r
:=
TreeNew
(
cmp
)
r
:=
TreeNew
(
cmp
)
set
:=
r
.
Set
set
:=
r
.
Set
a
:=
make
([]
int
,
N
)
a
:=
make
([]
int
,
N
)
...
@@ -794,7 +782,6 @@ func TestDelete1(t *testing.T) {
...
@@ -794,7 +782,6 @@ func TestDelete1(t *testing.T) {
}
}
for
_
,
k
:=
range
a
{
for
_
,
k
:=
range
a
{
set
(
k
,
0
)
set
(
k
,
0
)
//set(k, k)
}
}
for
i
,
k
:=
range
a
{
for
i
,
k
:=
range
a
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment