When representing any algebraic expression E which uses only binary operations in a 2-tree (every node other than the leaves has two children),
4 phương ánCó giải thích
Các phương án trả lời
Chọn một phương ánLời giảiChọn phương án để mở
Đáp án đúng: "the variable in E will appear as external nodes (leaves) and operations in internal nodes". Trong cây biểu thức, mỗi phép toán hai toán hạng cần đúng hai cây con làm toán hạng của nó, nên nút mang phép toán buộc phải có hai con và nằm bên trong cây; còn biến không nhận toán hạng nào nên không có con, tức là lá. Phương án "the operations in E will appear as external nodes (leaves) and variables in internal nodes" đảo vai: phép toán thành lá thì không còn chỗ gắn toán hạng, còn biến ở nút trong lại phải có hai con mà biến chẳng có toán hạng nào. Phương án "the variables and operations in E will appear only in internal nodes" để cây không có lá, điều bất khả vì mọi cây hữu hạn đều kết thúc ở những nút không con. Phương án "the variables and operations in E will appear only in external nodes (leaves)" để cây chỉ gồm lá, tức không nút nào có con, nên không biểu diễn được phép toán nối hai toán hạng.
Cùng phần 4
What is the minimum number of nodes in a nearly complete binary tree with height 4?
(In a tree the height of root is 1, and a binary tree with height h is called nearly complete if the tree is complete at level d for d = 1, 2, ..., h-1, and the leaves in the last level are all in the leftmost positions).Có lời giảiCâu hỏiTo implement an AVL tree, a concept balance factor is introduced (bal = height(right)-height(left)). Suppose an AVL tree is created by inserting to the tree the following keys sequentially:
6, 3, 7, 2, 5, 1
What is the balance factor of the node 6? (please note that the tree is still AVL)Có lời giảiCâu hỏiSuppose the binary search tree T is made by inserting the following keys consequently: 6, 7, 8, 9, 3, 2, 5, 4
What is the result of breadth-first traverse of T?Có lời giảiCâu hỏiCả 76 câu của chủ đề76 câu
Xuất hiện trong 1 bộ đề
Đi tiếp từ đây