Skip to content

Commit

Permalink
Merge pull request #3523 from issac5693/main1
Browse files Browse the repository at this point in the history
issue # #3477 - adding a rope datastructure
  • Loading branch information
ZoranPandovski committed Mar 17, 2023
2 parents fae9683 + b5796af commit 5288b71
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 66 deletions.
66 changes: 0 additions & 66 deletions data_structures/Fenwick tree/python/fenwick tree.py

This file was deleted.

38 changes: 38 additions & 0 deletions data_structures/Rope datastructure/python/Rope data structure.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Python3 program to concatenate two strings

# Function that concatenates strings a[0..n1-1]
# and b[0..n2-1] and stores the result in c[]
def concatenate(a, b, c, n1, n2):

# Copy characters of A[] to C[]
i = -1
for i in range(n1):
c[i] = a[i]

# Copy characters of B[]
for j in range(n2):
c[i] = b[j]
i += 1

# Driver Code
if __name__ == "__main__":
a = "Hi This is geeksforgeeks. "
n1 = len(a)

b = "You are welcome here."
n2 = len(b)

a = list(a)
b = list(b)

# Concatenate a[] and b[] and
# store result in c[]
c = [0] * (n1 + n2 - 1)

concatenate(a, b, c, n1, n2)

for i in c:
print(i, end = "")

# This code is contributed by
# Isaac

0 comments on commit 5288b71

Please sign in to comment.