Skip to content

Commit 5bda955

Browse files
Add DSA problems
1 parent f43a838 commit 5bda955

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

insertionsort.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
arr=[10,4,5,11,9,8,6]
2+
n=len(arr)
3+
for i in range(n):
4+
temp=arr[i]
5+
j=i-1
6+
while j>=0 and arr[j]>temp:
7+
arr[j+1]=arr[j]
8+
j-=1
9+
arr[j+1]=temp
10+
11+
print(arr)

removeduplicates.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
s="aabbbcd"
2+
temp=""
3+
for i in s:
4+
if i not in temp:
5+
temp+=i
6+
7+
print(temp)

0 commit comments

Comments
 (0)