Skip to content

Commit f80edd8

Browse files
committed
sql injection demo
1 parent ea531a1 commit f80edd8

5 files changed

Lines changed: 68 additions & 65 deletions

File tree

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22

33
# author: greyshell
4-
# description: learning heap methods
4+
# description: how to use heap ADT
55

66
import heapq
77

@@ -37,6 +37,7 @@ def heap_sort_compact(h):
3737
# noinspection PyProtectedMember
3838
def main():
3939
nums = [12, 7, 11, 15, 35, 17]
40+
# take a copy
4041
test_nums = nums.copy()
4142
print(f"list: {nums}")
4243

‎ds_algorithm/queue/concept_queue.py‎

Lines changed: 0 additions & 34 deletions
This file was deleted.

‎ds_algorithm/queue/demo_queue.py‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env python3
2+
3+
# author: greyshell
4+
# description: how to use queue ADT
5+
6+
from collections import deque as queue
7+
8+
9+
def main():
10+
q = queue()
11+
# enque: adding items at rear
12+
q.append(9)
13+
q.append(5)
14+
q.append(3)
15+
q.append(1)
16+
17+
# display the queue elements
18+
print(f"display the queue elements: {list(q)}")
19+
20+
# dequeue: deleting items from front
21+
data = q.popleft()
22+
print(f"item deleted from font: {data}")
23+
print(f"display the queue elements: {list(q)}")
24+
25+
# peek
26+
print(f"peek the front: {q[0]}")
27+
print(f"peek the rare: {q[-1]}")
28+
29+
# dequeue at rear
30+
data = q.pop()
31+
print(f"item deleted from rare: {data}")
32+
33+
34+
if __name__ == '__main__':
35+
main()

‎ds_algorithm/stack/concept_stack.py‎

Lines changed: 0 additions & 30 deletions
This file was deleted.

‎ds_algorithm/stack/demo_stack.py‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env python3
2+
3+
# author: greyshell
4+
# description: how to use stack ADT
5+
6+
from collections import deque as stack
7+
8+
9+
def main():
10+
s = stack()
11+
# push: stack grows from right
12+
s.append(9)
13+
s.append(5)
14+
s.append(3)
15+
s.append(1)
16+
17+
# display the stack elements
18+
print(f"display the stack elements: {list(s)}")
19+
20+
# pop: stack shrinks from right
21+
data = s.pop()
22+
print(f"popped: {data}")
23+
24+
print(f"display the stack elements: {list(s)}")
25+
26+
# peek
27+
print(f"peek the stack top: {s[-1]}")
28+
29+
30+
if __name__ == '__main__':
31+
main()

0 commit comments

Comments
 (0)