Select the correct statement. (full binary tree = proper binary tree = 2-tree)
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: "Every complete binary tree is also a full binary tree.". Theo quy ước mà đề nhắc, cây nhị phân full cũng là proper hay 2-tree, tức cây mà mọi nút trong đều có đúng hai con; còn cây complete là cây mà mọi mức đều được lấp kín. Khi mọi mức đã kín thì không nút trong nào thiếu con, nên cây complete tất yếu là cây full. Phương án "Every full binary tree is also a complete binary tree." sai theo chiều ngược: một cây mà mọi nút trong có hai con vẫn có thể lệch hẳn, chẳng hạn nhánh trái sâu bốn mức còn nhánh phải chỉ là một lá, lúc đó các mức không kín. Phương án "Every binary tree is either complete or full." sai vì dễ dựng cây không thuộc loại nào: gốc chỉ có con trái, con trái đó lại chỉ có con trái. Phương án "No binary tree is both complete and full." sai vì cây gồm một gốc và hai lá vừa kín mức vừa có nút trong đủ hai con.
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