Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
homework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ligang
homework
Commits
3b66662d
Commit
3b66662d
authored
6 years ago
by
牛家玺
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批改
parent
5ba32960
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
1 deletions
+14
-1
03-homework-ligang/moersi.py
+2
-0
04-homework-ligang/quick_sort.py
+2
-0
05-homework-ligang/coat_latin.py
+3
-0
05-homework-ligang/sort.py
+3
-0
06-homework-ligang/heaters.py
+3
-0
07-homework-ligang/matrix.py
+1
-1
No files found.
03-homework-ligang/moersi.py
View file @
3b66662d
...
@@ -7,6 +7,8 @@
...
@@ -7,6 +7,8 @@
def
word2moersi
(
m
):
def
word2moersi
(
m
):
alpha
=
[
".-"
,
"-..."
,
"-.-."
,
"-.."
,
"."
,
"..-."
,
"--."
,
"...."
,
".."
,
".---"
,
"-.-"
,
".-.."
,
"--"
,
"-."
,
"---"
,
alpha
=
[
".-"
,
"-..."
,
"-.-."
,
"-.."
,
"."
,
"..-."
,
"--."
,
"...."
,
".."
,
".---"
,
"-.-"
,
".-.."
,
"--"
,
"-."
,
"---"
,
".--."
,
"--.-"
,
".-."
,
"..."
,
"-"
,
"..-"
,
"...-"
,
".--"
,
"-..-"
,
"-.--"
,
"--.."
]
".--."
,
"--.-"
,
".-."
,
"..."
,
"-"
,
"..-"
,
"...-"
,
".--"
,
"-..-"
,
"-.--"
,
"--.."
]
# words 可以这么写morse_dict = {chr(i + 97): morse[i] for i in range(0, len(morse))}
words
=
[
"a"
,
"b"
,
"c"
,
"d"
,
"e"
,
"f"
,
"g"
,
"h"
,
"i"
,
"j"
,
"k"
,
"l"
,
"m"
,
"n"
,
"o"
,
"p"
,
"q"
,
"r"
,
"s"
,
"t"
,
"u"
,
words
=
[
"a"
,
"b"
,
"c"
,
"d"
,
"e"
,
"f"
,
"g"
,
"h"
,
"i"
,
"j"
,
"k"
,
"l"
,
"m"
,
"n"
,
"o"
,
"p"
,
"q"
,
"r"
,
"s"
,
"t"
,
"u"
,
"v"
,
"w"
,
"x"
,
"y"
,
"z"
]
"v"
,
"w"
,
"x"
,
"y"
,
"z"
]
#建立两者间的映射关系
#建立两者间的映射关系
...
...
This diff is collapsed.
Click to expand it.
04-homework-ligang/quick_sort.py
View file @
3b66662d
...
@@ -28,3 +28,5 @@ def quick_sort(sort_list,start,end):
...
@@ -28,3 +28,5 @@ def quick_sort(sort_list,start,end):
l
=
[
8
,
6
,
99
,
44
,
2
,
3
,
5
,
7
,
44
,
77
,
9
]
l
=
[
8
,
6
,
99
,
44
,
2
,
3
,
5
,
7
,
44
,
77
,
9
]
print
(
quick_sort
(
l
,
0
,
len
(
l
)
-
1
))
print
(
quick_sort
(
l
,
0
,
len
(
l
)
-
1
))
print
(
q_sort
(
l
))
print
(
q_sort
(
l
))
#ok
This diff is collapsed.
Click to expand it.
05-homework-ligang/coat_latin.py
View file @
3b66662d
...
@@ -39,3 +39,5 @@ str = "The quick brown fox jumped over the lazy dog"
...
@@ -39,3 +39,5 @@ str = "The quick brown fox jumped over the lazy dog"
l
=
Latin
()
l
=
Latin
()
c
=
l
.
coat_latin
(
str
)
c
=
l
.
coat_latin
(
str
)
print
(
c
)
print
(
c
)
#ok
\ No newline at end of file
This diff is collapsed.
Click to expand it.
05-homework-ligang/sort.py
View file @
3b66662d
...
@@ -53,3 +53,5 @@ utils = SortUtils()
...
@@ -53,3 +53,5 @@ utils = SortUtils()
s
=
utils
.
sort
(
str
,
'quick'
)
s
=
utils
.
sort
(
str
,
'quick'
)
#print(r)
#print(r)
print
(
s
)
print
(
s
)
#ok
\ No newline at end of file
This diff is collapsed.
Click to expand it.
06-homework-ligang/heaters.py
View file @
3b66662d
...
@@ -31,3 +31,5 @@ heater = [1,4]
...
@@ -31,3 +31,5 @@ heater = [1,4]
h
=
Heater
()
h
=
Heater
()
s
=
h
.
findRadius
(
house
,
heater
)
s
=
h
.
findRadius
(
house
,
heater
)
print
(
s
)
print
(
s
)
#ok
\ No newline at end of file
This diff is collapsed.
Click to expand it.
07-homework-ligang/matrix.py
View file @
3b66662d
...
@@ -26,4 +26,4 @@ class Solution:
...
@@ -26,4 +26,4 @@ class Solution:
matrix
=
[[
1
,
2
,
3
,
4
],
[
5
,
1
,
2
,
3
],
[
9
,
5
,
1
,
2
]]
matrix
=
[[
1
,
2
,
3
,
4
],
[
5
,
1
,
2
,
3
],
[
9
,
5
,
1
,
2
]]
solu
=
Solution
()
solu
=
Solution
()
solu
.
isToeplitzMatrix
(
matrix
)
print
(
solu
.
isToeplitzMatrix
(
matrix
)
)
This diff is collapsed.
Click to expand it.
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