Updated README

This commit is contained in:
Anup Kumar Panwar
2019-07-06 11:11:20 +05:30
parent 831558d38d
commit 4e413c0183
45 changed files with 404 additions and 702 deletions

View File

@ -0,0 +1,17 @@
from __future__ import print_function
# Function to print element and NGE pair for all elements of list
def printNGE(arr):
for i in range(0, len(arr), 1):
next = -1
for j in range(i+1, len(arr), 1):
if arr[i] < arr[j]:
next = arr[j]
break
print(str(arr[i]) + " -- " + str(next))
# Driver program to test above function
arr = [11,13,21,3]
printNGE(arr)