Question: 2 Problems 1. Assume your keyboard does not have a backspace key; thus, if you make a data entry error, you must use the #

 2 Problems 1. Assume your keyboard does not have a backspacekey; thus, if you make a data entry error, you must use

2 Problems 1. Assume your keyboard does not have a backspace key; thus, if you make a data entry error, you must use the # character to correct your mistake as follows: Each # erases the previous character entered, but consecutive # characters do not cancel out, instead they are applied in sequence and so erase several characters. For instance if the input line is: abe defgh#2kmn opqr##wxyz the corrected output would be: Write a function to perform this correction using stack. the positions (nodes) of Tree abc defg2klmn opwxyz 2. Based on the lecture slides, a traversal of a tree T is a systematic way of accessing, or visiting, all (a) Preorder traversal: Sequence of visiting nodes preorder traversal: Root, Left, Right) - Visit the node -Call itself to traverse the nodes left subtree Call tself to traverse the nodes right subtree (b) Postorder traversal: Sequence of visiting nodes in postorder traversal: (Left, Right, Root) Call itself to traverse the nodes left subtree - Call itself to traverse the nodes right subtree - Visit the node (b) Postorder traversal: Sequence of visiting nodes in postorder traversal: (Left, Right, Root) Call itself to traverse the nodes left subtree - Call itself to traverse the nodes right subtree - Visit the node (c) Inorder traversal: Sequence of visiting nodes in inorder traversal (Left, Root, Right) Call itself to traverse the nodes left subtree - Visit the node - Call itself to traverse the nodes right subtree. Write the preorder, postorder and inorder traversal of the following tree. 5 4100 20 2 3 Deliverables A PDF file of Problem 1: 1. Half a page report (font 12) describing the following statements: (a) The reason it is better to use stack for this problem. (b) The algorithm you have used to tackle this problem 2. Code file(s) of your implementation. Problem 2: The requested solution 2 Problems 1. Assume your keyboard does not have a backspace key; thus, if you make a data entry error, you must use the # character to correct your mistake as follows: Each # erases the previous character entered, but consecutive # characters do not cancel out, instead they are applied in sequence and so erase several characters. For instance if the input line is: abe defgh#2kmn opqr##wxyz the corrected output would be: Write a function to perform this correction using stack. the positions (nodes) of Tree abc defg2klmn opwxyz 2. Based on the lecture slides, a traversal of a tree T is a systematic way of accessing, or visiting, all (a) Preorder traversal: Sequence of visiting nodes preorder traversal: Root, Left, Right) - Visit the node -Call itself to traverse the nodes left subtree Call tself to traverse the nodes right subtree (b) Postorder traversal: Sequence of visiting nodes in postorder traversal: (Left, Right, Root) Call itself to traverse the nodes left subtree - Call itself to traverse the nodes right subtree - Visit the node (b) Postorder traversal: Sequence of visiting nodes in postorder traversal: (Left, Right, Root) Call itself to traverse the nodes left subtree - Call itself to traverse the nodes right subtree - Visit the node (c) Inorder traversal: Sequence of visiting nodes in inorder traversal (Left, Root, Right) Call itself to traverse the nodes left subtree - Visit the node - Call itself to traverse the nodes right subtree. Write the preorder, postorder and inorder traversal of the following tree. 5 4100 20 2 3 Deliverables A PDF file of Problem 1: 1. Half a page report (font 12) describing the following statements: (a) The reason it is better to use stack for this problem. (b) The algorithm you have used to tackle this problem 2. Code file(s) of your implementation. Problem 2: The requested solution

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!