if balanced and is_empty()return true elsereturn false def matches(openclose)opens "([{closes ")]}return opens index(open=closes index(close print(par_checker('{{([][])}()}')print(par_checker('[{()]')these two examples show that stacks are very important data structures for the processing of language constructs in computer science almost any notation you can think of has some type of nested symbol that must be matched in balanced order there are number of other important uses for stacks in computer science we will continue to explore them in the next sections converting decimal numbers to binary numbers in your study of computer scienceyou have probably been exposed in one way or another to the idea of binary number binary representation is important in computer science since all values stored within computer exist as string of binary digitsa string of and without the ability to convert back and forth between common representations and binary numberswe would need to interact with computers in very awkward ways integer values are common data items they are used in computer programs and computation all the time we learn about them in math class and of course represent them using the decimal number systemor base the decimal number and its corresponding binary equivalent are interpreted respectively as and but how can we easily convert integer values into binary numbersthe answer is an algorithm called "divide by that uses stack to keep track of the digits for the binary result the divide by algorithm assumes that we start with an integer greater than simple iteration then continually divides the decimal number by and keeps track of the remainder the first division by gives information as to whether the value is even or odd an even value will have remainder of it will have the digit in the ones place an odd value will have remainder of and will have the digit in the ones place we think about building our binary number as sequence of digitsthe first remainder we compute will actually be the last digit in the sequence as shown in figure we again see the reversal property that signals that stack is likely to be the appropriate data structure for solving the problem the python code in below implements the divide by algorithm the function divide_by_ takes an argument that is decimal number and repeatedly divides it by line uses the built-in modulo operator%to extract the remainder and line then pushes it on the stack after the division process reaches binary string is constructed in lines - line the stack abstract data type