Question
When building a Huffman tree, the two nodes with the
smallest frequencies are combined. Which line correctly creates a new parent node newNode with left and right children and its data (frequency)? // Assume Node class has data, left, right members // Node* l and Node* r are the two lowest frequency nodes Node* newNode = new Node(__________); // Line to complete newNode->left = l; newNode->right = r;Solution
Correct Answer: A • Code Analysis: o l and r are pointers to the two nodes with the smallest frequencies. o newNode is being created, and its data member needs to store the combined frequency. • Explanation of Correct Answer (A): l->data + r->data o The fundamental principle of Huffman tree construction is that the frequency (or weight) of a parent node is the sum of the frequencies of its left and right children. This ensures that the total frequency of the subtree is correctly represented.
A holding company is required to prepare consolidated financial statements. The financials of which of the following will be includes in the consolidate...
GH Ltd took a term loan of Rs.24 crore for a period of 20 years to be repaid in equal annual instalments. The interest is 10% p.a. on reducing balance. ...
If share capital is ₹10 lakh, reserves ₹5 lakh, and accumulated losses ₹3 lakh, Deffered tax liabilities are ₹1 lakh, provision for gratuity is ...
Based on the below information, calculate the net cash flow of the company from operating activities?Â
Net Profit = ₹1,80,000Â
Depreci...
In a cash flow statement, issuance of shares is classified under:
Which of the following statements are not true regarding the issuance of a bank guarantee?
1. All bank guarantees have an expiry period and expir...
Which of the following is correct about the liquidity position of a company whose current ratio is 2.5, and quick ratio is only 0.9?Â
Which of the following statement is true regarding standard costing?
If you want to understand the financial performance of a company over a specific accounting period, which of the following financial statement will be u...
Which of the following statements about Mortgage are not true?
1.   Under a mortgage, the legal ownership of the asset can be transferred ...