Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Q. By making use of stacks, write an algorithm to determine whether the infix expression has balanced parenthesis or not.
Ans.
Algorithm parentheses is written below
This specific algorithm reads a source program and parses it to make sure all opening -closing parenthesis are systematically paired
1. loop (more data)
read (character)
if (character is not a closing parenthesis)
pushstack ( stack, character)
else
if (character is closing parenthesis)
popstack (stack, token)
while ( token is not an opening paranthesis)
endwhile end if
end if end loop
if (not emptystack (stack))
print (Error: opening parenthesis not matched)
end parseparens.
Q. In the given figure find the shortest path from A to Z using Dijkstra's Algorithm. Ans: 1. P=φ; T={A,B,C,D,E,F,G,H,I,J,K,L,M,Z} Let L(A)
C compiler does not verify the bounds of arrays. It is your job to do the essential work for checking boundaries wherever required. One of the most common arrays is a string tha
Q. A linear array A is given with lower bound as 1. If address of A[25] is 375 and A[30] is 390, then find address of A[16].
Explain class P problems Class P is a class of decision problems that can be solved in polynomial time by(deterministic) algorithms. This class of problems is kno
One can change a binary tree into its mirror image by traversing it in Postorder is the only proecess whcih can convert binary tree into its mirror image.
Conversion of Forest into Tree A binary tree may be used to show an entire forest, since the next pointer in the root of a tree can be used to point to the next tree of the for
Describe an algorithm to play the Game of Nim using all of the three tools (pseudocode, flowchart, hierarchy chart)
Implementation of Stack :- Stacks can be executed in the 2 ways: a) Arrays b) Linked List
W h at are the different ways by which we can represent graph? Represent the graph drawn below using those ways. T he d iff e r e nt w a y s by
What are circular queues? Circular queue: Static queues have a very large drawback that once the queue is FULL, even though we erase few elements from the "front" and relieve
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd