Function to create a tree for a postfix expression


Question 1)a) Draw the depth first search tree and a breadth first search tree for the graph shown below, taking node A as the initial node stepwise.

1762_Graph.jpg

b) What are circular queues? How do they differ from general queues? Describe how elements can be added and removed from the circular queue.

Question 2)a) Write an appropriate function to delete any node from a doubly linked list. For the set of elements given below trace the function stepwise to delete nodes with values 12, 65 and 72 respectively with appropriate pictorial representations of the nodes and their links.

12, 14, 24, 33, 65, 42, 54, 72.

b) Write the function to add two long integers represented in the form of two singly linked lists. (Note: Each digit of the number is a node of the linked list) The function should return a pointer to the resultant list.

Question 3)a) Write a function to create a tree for a postfix expression. Trace the same stepwise for the expression (A+ ((B-C)*D) ^E^F) by first giving the equivalent postfix expression.

b) Write a note on hash functions.

Request for Solution File

Ask an Expert for Answer!!
Data Structure & Algorithms: Function to create a tree for a postfix expression
Reference No:- TGS06550

Expected delivery within 24 Hours