Two brackets are considered to be a matched pair if the an opening
bracket (i.e., (, [, or { ) occurs to the left of a closing bracket (i.e., ),
], or }) of the exact same type. There are three types of matched
pairs of brackets: [], {}, and (). A matching pair of brackets is not
balanced if the set of brackets it encloses are not matched. WAP to
determine whether the input sequence of brackets is balanced or not.
If a string is balanced, it print YES on a new line; otherwise, print
NO on a new line.
Example: Input: {[()]} and Output: YES
Input: {[(])} and Output: NO
WAP to convert an infix expression into its equivalent prefix
notation.
WAP to convert an infix expression into its equivalent postfix
notation.
Write a menu driven program to perform the following
operations of a stack using linked list by using suitable user defined
functions for each case.
Write a menu driven program to perform the following
operations of a stack using array by using suitable user defined
functions for each case.
a) Check if the stack is empty b) Display the contents of stack
c) Push d) Pop
Find and display the values of both sides of the following mathematical series expression and
an absolute difference of both sides. User can input either of angles in degree 90, 60, 30 etc.
sin(x) = x −
x
3
3!
+
x
5
5!
−
x
7
7!
+
x
9
9!
Your task is to then create a java program that when given an acronym with its meaning plus some sentence, the program replaces the first occurrence of the acronym in the sentence with its meaning.
Sample run 1:
Enter an acronym and its meaning (separated by spaces): NUST Namibia University of Science and Technology
Enter a sentence: Welcome to my NUST. Output: Welcome to my Namibia University of Science and Technology.
Given a number N, create a 2D arrays with n rows and n columns. Now inspect the matrix pattern below and come up with a formula to populate the array for any give NXN matrix.
5 4 3 2 1
10 8 6 4 2
15 12 9 6 3
20 16 12 8 4
25 20 15 10 5