Open
Conversation
Added Kmp string searching algorithm
Added Linear String Search
Added Fast exponentiation
Adding Fast Exponentiation: both recursive and iterative method
Added efficient MergeSort
Added LinearSort
Added HeapSort
Added BinarySeach
Added Binary Seach
Create ascii-char_cpp
Create bubblesort_java
Added Recursive BinarySeach
Refactored BubbleSort to proper location
Added Iterative exponentiation
Added DFS
Create 1552b.cpp
Create 1550b.cpp
Create 1530c.cpp
Create 1530d.cpp
Create 1550b
Create second.cpp
Create third.cpp
Create fourth.cpp
Added Selection Sort
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changing code in python
define size n = even only
n = 8
so this heart can be made n//2 part left,
n//2 part right, and one middle line
i.e; columns m = n + 1
m = n+1
loops for upper part
for i in range(n//2-1):
for j in range(m):
# condition for printing stars to GFG upper line
if i == n//2-2 and (j == 0 or j == m-1):
print("", end=" ")
# condition for printing stars to left upper
elif j <= m//2 and ((i+j == n//2-3 and j <= m//4)
or (j-i == m//2-n//2+3 and j > m//4)):
print("", end=" ")
# condition for printing stars to right upper
elif j > m//2 and ((i+j == n//2-3+m//2 and j < 3m//4)
or (j-i == m//2-n//2+3+m//2 and j >= 3m//4)):
print("*", end=" ")
# condition for printing spaces
else:
print(" ", end=" ")
print()
loops for lower part
for i in range(n//2-1, n):
for j in range(m):
# condition for printing stars
if (i-j == n//2-1) or (i+j == n-1+m//2):
print('*', end=" ")
# condition for printing GFG
elif i == n//2-1:
print(' ', end=" ")
# condition for printing spaces
else:
print(' ', end=" ")