Answer and Explanation:
Recursion is a technique to solve a problem where a function in a program calls itself at specified times.
The three situations when recursion is the single option available to solve a problem are:
- When a task is required to repeat itself without the use of loop.
- When we want to take a print of the result of the functions used in the program which calls itself in the order which is reversed. This makes use of stack.
- Where the solutions are provided such that it follows the order in solving from the inner most to the outer extreme level of the tasks. As in case of recursion in deleting the files and the directories, files are deleted followed by directories.
Answer:
A line of code to create a constant called MAX that will hold the size of an array that can store up to 25 decimal values. Separate each item with 1 space, and end the line with a semi-colon.
Here,
const int MAX = 25;
false becase i do it all over power ponts
I be live it's a I may be wrong
Answer:
Check the explanation
Explanation:
#source code:
import sys
def is_balanced(input_string):
stack = []
for i in input_string:
if(i=="{"):
stack.append("{")
elif(i=="}"):
stack.pop()
if(len(stack)==0):
return True
else:
return False
if __name__ == '__main__':
try:
_input_string = sys.argv[1]
balanced = is_balanced(_input_string)
if balanced:
print("The string {} is balanced".format(_input_string))
else:
print("The string {} is not balanced".format(_input_string))
except:
print("String can't be empty")
Kindly check the attached image below to see the code screenshot and code output.