CS505 2026 islam
|
|
Title of test:
![]() CS505 2026 islam Description: CS505 2026 islam |



| New Comment |
|---|
NO RECORDS |
|
The …… of a binary tree equals (number of edges + 1) from the root node to the deepest leaf is the tree. height. width. length. depth. What is a full binary tree?. Each node has zero or two children. Each node has exactly two children. Each node has exactly one or two children. Internal nodes are the nodes that have …… children. at most one. at least one. one or more. exactly one. a tree with 255 nodes has …... edge. 256. 255. 254. 200. Having a complete binary tree, a node with index 9 should have a parent with index ……. 5. 4. 18. 19. Which of the following is not an advantage of trees?. Hierarchical structure. Faster search. Undo/Redo operations in a notepad. In a full binary tree if number of internal nodes is I, then number of leaves L are?. L = 2*I. L = I + 1. L = I – 1. L = 2*I – 1. Given a binary search tree, which traversal type would print the values in the nodes in sorted order?. Preorder. Postorder. Inorder. . None of the above. Which of the following statements about binary trees is NOT true?. Every binary tree has at least one node. Every non-empty tree has exactly one root node. Every node has at most two children. . Every non-root node has exactly one parent. Which of the following is false about a binary search tree?. The left child is always less than its parent. The right child is always greater than its parent. The left and right sub-trees should also be binary search trees. In order sequence gives decreasing order of elements. What is the specialty about the inorder traversal of a binary search tree?. It traverses in a non increasing order. It traverses in an increasing order. It traverses in a random fashion. It traverses based on priority of the node. A class declaration is usually put in a(n) ……. file whose name has the form className.h. header. source. resource. application. Definitions of the function members of class are usually put in a(n) ……... file whose name has the form className.cpp. header. source. resource. application. A(An) ……… constructor is used when an object declaration does not supply initial values for the data members of the object. copy. overloaded. default. main. A(An) ........ constructor initializes them to specific values supplied in the object's declaration. overloaded. copy. default. main. ………… function enables changing the private data members values. Accessors. Constructors. Mutators. Destructors. Defining several functions with the same name is called …………. overloading. overwriting. . information hiding. A(An) ………. constructor has no parameters. overloaded. copy. default. main. A class in C++ contains …………. data. functions. data and functions. arrays. The data members and functions of a class in C++ are by default ……. protected. private. public. friend. Destructors are used to ……………. initialize the objects. construct the data members. delete the objects. both initialize the objects & construct the data members. Every class should have an overloaded constructor. ( ). TRUE. False. A member function is implemented in the header file. ( ). False. TRUE. The destructor is used to remove the objects. ( ). False. TRUE. A class should have only one constructor. ( ). False. TRUE. A class may have more than one destructor. False. TRUE. public data members can be accessed from outside the class. False. TRUE. In classes, we usually put functions in the private area. False. TRUE. The header file and implementation file called class library. False. TRUE. public class A { } is a valid class declaration. ( ). False. TRUE. . <include> "userdefined.h" is the correct syntax to add the header file in the C++ program. (. False. TRUE. . Which of the following is the proper declaration of a pointer?. int x;. int &x;. ptr x;. int *x;. Which of the following gives the memory address of integer variable a;?. *a;. a;. &a;. address(a);. Which of the following gives the memory address of a variable pointed to by pointer a?. a;. *a;. &a;. address(a);. Which of the following gives the value stored at the address pointed to by the pointer a?. . a;. val(a);. *a;. &a;. Which of the following is the proper keyword to allocate memory?. new. malloc. create. value. Which of the following is the proper keyword to deallocate memory?. free. delete. clear. remove. Which of the following correctly declares an array?. int anarray[10];. int anarray;. anarray{10};. array anarray[10];. What is the index number of the last element of an array with 29 elements?. 29. 28. 0. Programmer-defined. Which of the following is a two-dimensional array?. array anarray[20][20];. int anarray[20][20];. int array[20, 20];. char array[20];. Which of the following correctly accesses the seventh element stored in foo, an array with 100 elements?. foo[6];. foo[7];. foo(7);. foo;. Which of the following gives the memory address of the first element in array foo, an array with 100 elements?. foo[0];. foo;. &foo;. . foo[1];. |





