From 5ef5f67a51b658d768c6bf6f2f4e68c45736ca15 Mon Sep 17 00:00:00 2001 From: Jai Kumar Dewani Date: Sat, 19 Oct 2019 00:44:01 +0530 Subject: [PATCH] Added more details about the problem statement (#1367) * Update DIRECTORY * Updated DIRECTORY * Fixed bug in directory build and re-build the directory.md * fixed url issue * fixed indentation in Directory.md * Add problem-18 of project-euler * Delete sol1.py * Delete files * Added more details to question * Added doctest in printNGE() * Made changes to fix Travis CI build * Remove the trailing whitespace --- data_structures/stacks/next_greater_element.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/data_structures/stacks/next_greater_element.py b/data_structures/stacks/next_greater_element.py index 02a86196f..29a039b96 100644 --- a/data_structures/stacks/next_greater_element.py +++ b/data_structures/stacks/next_greater_element.py @@ -1,6 +1,13 @@ -# Function to print element and NGE pair for all elements of list def printNGE(arr): - + """ + Function to print element and Next Greatest Element (NGE) pair for all elements of list + NGE - Maximum element present afterwards the current one which is also greater than current one + >>> printNGE([11,13,21,3]) + 11 -- 13 + 13 -- 21 + 21 -- -1 + 3 -- -1 + """ for i in range(0, len(arr), 1): next = -1