Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
1
1-homework-yanjun
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
bonnieyan
1-homework-yanjun
Commits
cde2f2e1
Commit
cde2f2e1
authored
Feb 25, 2019
by
牛家玺
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
作业批改
parent
23ca2b7d
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
31 additions
and
8 deletions
+31
-8
10-homework-yanjun/mergeTwoLists.py
+4
-0
10-homework-yanjun/min_stack.py
+2
-0
11-homework-yanjun/sql
+4
-2
2-homework-yanjun/bubbleSort.py
+4
-2
4-homework-yanjun/convert.py
+3
-2
5-homework-yanjun/goat_latin.py
+2
-0
5-homework-yanjun/regular.py
+2
-0
5-homework-yanjun/sort_utils.py
+3
-0
6-homework-yanjun/heaters.py
+4
-2
7-homework-yanjun/matrix.py
+2
-0
8-homework-yanjun/tree_depth.py
+1
-0
No files found.
10-homework-yanjun/mergeTwoLists.py
View file @
cde2f2e1
...
...
@@ -16,6 +16,10 @@ class ListNode:
class
Solution
:
#这里不需要做递归 时间复杂度比较高
#可以考虑用遍历方式去实现
#具体算法参考归并排序
def
mergeTwoLists
(
self
,
l1
,
l2
):
"""
:type l1: ListNode
...
...
10-homework-yanjun/min_stack.py
View file @
cde2f2e1
...
...
@@ -77,3 +77,4 @@ if __name__ == "__main__":
#ok
\ No newline at end of file
11-homework-yanjun/sql
View file @
cde2f2e1
...
...
@@ -25,4 +25,6 @@
请写出SQL语句
select name, population, area from World where area > 3000000 or population > 25000000
\ No newline at end of file
select name, population, area from World where area > 3000000 or population > 25000000
#ok
\ No newline at end of file
2-homework-yanjun/bubbleSort.py
View file @
cde2f2e1
...
...
@@ -9,4 +9,6 @@ def bubbleSort(A):
if
__name__
==
'__main__'
:
bubbleSort
([
1
,
15
,
2
,
5
,
3
,
18
,
6
])
\ No newline at end of file
bubbleSort
([
1
,
15
,
2
,
5
,
3
,
18
,
6
])
#ok
\ No newline at end of file
4-homework-yanjun/convert.py
View file @
cde2f2e1
...
...
@@ -21,4 +21,5 @@ def convert(s, numRows):
return
''
.
join
(
rows
)
print
(
convert
(
"LEETCODEISHIRING"
,
4
))
print
(
convert
(
"LEETCODEISHIRING"
,
3
))
\ No newline at end of file
print
(
convert
(
"LEETCODEISHIRING"
,
3
))
#ok
\ No newline at end of file
5-homework-yanjun/goat_latin.py
View file @
cde2f2e1
...
...
@@ -46,3 +46,4 @@ s = "The quick brown fox jumped over the lazy dog".split(' ')
#print(s)
print
(
goat_latin
(
s
))
#ok
\ No newline at end of file
5-homework-yanjun/regular.py
View file @
cde2f2e1
...
...
@@ -38,3 +38,4 @@ p.get_emails()
p
.
get_ips
()
p
.
get_phone_numbers
()
p
.
get_urls
()
#ok
\ No newline at end of file
5-homework-yanjun/sort_utils.py
View file @
cde2f2e1
class
SortUtils
:
def
sort
(
self
,
f
,
s
):
if
f
==
"bubble"
:
#最好写成函数调用
for
i
in
range
(
len
(
s
)
-
1
):
for
j
in
range
(
len
(
s
)
-
i
-
1
):
if
s
[
j
]
>
s
[
j
+
1
]:
...
...
@@ -8,6 +9,8 @@ class SortUtils:
print
(
s
)
#print(s)
if
f
==
"quick"
:
#这里可以通过使用构造方法来处理
#如果使用这一调用方法里面的self就没有意义的 可以用静态装饰器
SortUtils
.
__quick_sort
(
self
,
s
,
0
,
len
(
s
)
-
1
)
def
__quick_sort
(
self
,
sort_list
,
start_index
,
end_index
):
...
...
6-homework-yanjun/heaters.py
View file @
cde2f2e1
...
...
@@ -17,4 +17,6 @@ class Heater:
h
=
Heater
()
result
=
h
.
findRadius
([
1
,
2
,
3
,
4
,
6
],
[
1
,
4
])
print
(
result
)
\ No newline at end of file
print
(
result
)
#ok
\ No newline at end of file
7-homework-yanjun/matrix.py
View file @
cde2f2e1
...
...
@@ -35,3 +35,4 @@ matrix = [[1, 2, 3, 4], [5, 1, 2, 3], [9, 5, 1, 2]]
result
=
m
.
topu_matrix
(
matrix
)
print
(
result
)
#ok
\ No newline at end of file
8-homework-yanjun/tree_depth.py
View file @
cde2f2e1
...
...
@@ -5,6 +5,7 @@ class node():
self
.
right
=
r
#这里可以不用递归实现 做一遍遍历就行了
def
listcreattree
(
root
,
llist
,
i
):
if
i
<
len
(
llist
):
if
llist
[
i
]
==
'null'
:
...
...
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