Commit cde2f2e1 by 牛家玺

作业批改

parent 23ca2b7d
......@@ -16,6 +16,10 @@ class ListNode:
class Solution:
#这里不需要做递归 时间复杂度比较高
#可以考虑用遍历方式去实现
#具体算法参考归并排序
def mergeTwoLists(self, l1, l2):
"""
:type l1: ListNode
......
......@@ -77,3 +77,4 @@ if __name__ == "__main__":
#ok
\ No newline at end of file
......@@ -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
......@@ -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
......@@ -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
......@@ -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
......@@ -38,3 +38,4 @@ p.get_emails()
p.get_ips()
p.get_phone_numbers()
p.get_urls()
#ok
\ No newline at end of file
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):
......
......@@ -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
......@@ -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
......@@ -5,6 +5,7 @@ class node():
self.right = r
#这里可以不用递归实现 做一遍遍历就行了
def listcreattree(root, llist, i):
if i < len(llist):
if llist[i] == 'null':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment