Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
4
4_homework_yangpeng
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
杨鹏
4_homework_yangpeng
Commits
e0dc2a92
Commit
e0dc2a92
authored
Jan 13, 2019
by
杨鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update homework
parent
451fd38f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
0 deletions
+45
-0
basic_chat.aiml
+19
-0
quick_sort.py
+26
-0
No files found.
basic_chat.aiml
View file @
e0dc2a92
...
@@ -98,6 +98,25 @@
...
@@ -98,6 +98,25 @@
</template>
</template>
</category>
</category>
<category>
<pattern>我 爱 *</pattern>
<template>
<think>
<set name="hobit"><star/></set>
</think>
哇塞,你好
<condition name="hobit">
<li value="健身">帅啊,型男范儿!</li>
<li value="读书">有内涵啊</li>
<li value="打游戏">自由啊,羡慕你</li>
<li>666啊</li>
</condition>
</template>
</category>
...
...
quick_sort.py
0 → 100644
View file @
e0dc2a92
'''
快排,是原地排序,需要输入排序的上下边界,即数组下标
'''
def
quick_sort
(
array
,
left
,
right
):
if
left
>=
right
:
#判断输入的边界是否合法,不合法则直接返回
return
low
=
left
high
=
right
key
=
array
[
low
]
while
left
<
right
:
while
left
<
right
and
array
[
right
]
>
key
:
right
-=
1
array
[
left
]
=
array
[
right
]
while
left
<
right
and
array
[
left
]
<=
key
:
left
+=
1
array
[
right
]
=
array
[
left
]
array
[
right
]
=
key
quick_sort
(
array
,
low
,
left
-
1
)
quick_sort
(
array
,
left
+
1
,
high
)
print
(
array
)
array
=
[
2
,
1
,
3
,
55
,
34
,
56
,
4
,
109
,
15
]
quick_sort
(
array
,
0
,
8
)
#quick_sort(array,8,0)
\ No newline at end of file
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