Answer:
Each time you insert a new node, call the function to adjust the sum.
This method has to be called each time we insert new node to the tree since the sum at all the
parent nodes from the newly inserted node changes when we insert the node.
// toSumTree method will convert the tree into sum tree.
int toSumTree(struct node *node)
{
if(node == NULL)
return 0;
// Store the old value
int old_val = node->data;
// Recursively call for left and right subtrees and store the sum as new value of this node
node->data = toSumTree(node->left) + toSumTree(node->right);
// Return the sum of values of nodes in left and right subtrees and
// old_value of this node
return node->data + old_val;
}
This has the complexity of O(n).
Explanation:
It is a code for representing 128 English characters as numbers, with each letter assigned a number from 0 to 127. For example, the ASCII code for uppercase M is 77. Most computers use ASCII codes to represent text, which makes it possible to transfer data from one computer to another.
Answer:
Ally typed a business letters she most likely used a <u>Word Processor</u>.
Explanation:
Word processors are the tools that are used to process the text in terms of formatting, printing and editing the text document. These programs or software are used to write the text document with ease.
Microsoft word and word perfect are the examples of the word processors.
We can write the text on note pad as well, but we cannot apply different fonts style, size and formatting techniques on that application. Word processors provide a lot of fonts styles and formatting options to make the document appealing.