File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
pygorithm/data_structures Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ def __is_operand(char):
9595 # OLD VERSION
9696 # return ord(char) >= ord('a') and ord(char) <= ord('z') \
9797 # or ord(char) >= ord('A') and ord(char) <= ord('Z')
98- return True if ord (char ) in [ord (c ) for c in list ( ascii_letters ) ] else False
98+ return True if ord (char ) in [ord (c ) for c in ascii_letters ] else False
9999
100100 @staticmethod
101101 def __precedence (char ):
@@ -127,7 +127,8 @@ def infix_to_postfix(self):
127127 postfix .append (top_operator )
128128 top_operator = self .my_stack .pop ()
129129 else :
130- while not self .my_stack .is_empty () and self .__precedence (self .expression [i ] <= self .__precedence (self .my_stack .peek ())):
130+ while not self .my_stack .is_empty () \
131+ and self .__precedence (self .expression [i ] <= self .__precedence (self .my_stack .peek ())):
131132 postfix .append (self .my_stack .pop ())
132133 self .my_stack .push (self .expression [i ])
133134
You can’t perform that action at this time.
0 commit comments