Question

HELP OBJECT ORIENTED PROGRAMMING QUESTIONS 1. Binary Search Tree Insert the following sequence: 7, 3, 11,...

HELP OBJECT ORIENTED PROGRAMMING QUESTIONS

1. Binary Search Tree

Insert the following sequence: 7, 3, 11, 1 , 5, 9, 13 to an empty Binary Search Tree.

Then perform different traversal on this tree. Which statement is correct?

a. In Order Traversal: 1 3 5 7 9 11 13

b. Pre Order Traversal: 7 3 1 5 11 9 13

c. Post Order Traversal: 1 5 3 9 13 11 7

d. All of the above

e. None of these

2. Object Relationship

What is the best description for the relationship between the following two class objects:

a. Composition

b. Inheritance

c. Aggregation

d. Association

e. None of these

3. Balanced BST

The following Red-black tree insertion cases; Insert 8 to the existing BST.

==>

What is the balancing operation performed for this insertion?

a. Uncle Black Right Rotation

b. Uncle Black Left Rotation

c. Uncle Red Coloring Change

d. None of these

4. Binary Search Tree

For a known balanced Binary Search Tree (BST) class, if there is no copy constructor, nor assignment operator= available. Which of the following method can create another balanced BST would be the identical nodes?

a. Inserting the node follow the In Order Traversal to a new BST.

b. Inserting the node follow the Pre Order Traversal to a new BST.

c. Inserting the node follow the Post Order Traversal to a new BST.

d. All of the above

e. None of these

5. STL

The C++ 11 introduced auto type and range loop. It has made the coding more meaningful and less error prone. However, not all STL container you can use this syntax. What public supported STL classes can not run auto range loop?  

a. stack

b. queue

c. priority_queue

d. All of the above

e. None of these

6. Linked List

What is the output of following function for start pointing to first node of following linked list?

1-> 2-> 3-> 4-> 5-> 6

a. 1 2 3 4 5 6

b. 1 3 5 5 3 1

c. 2 4 6 6 4 2

d. 1 2 3 4 5

e. None of these

7. Linked List

Which of the following is true about Linked List data structure when compared with array?

a. Arrays have better cache locality that can make them better in terms of performance.

b. It is easy to insert and delete elements in Linked List.

c. Random access is not allowed in a typical implementation of Linked Lists.

d. The size of array has to be pre-decided, linked lists can change their size any time.

All of the above

8. Class

In C++, a member function can always access the __________ in its own class.

a. public function members

b. private function members

c. private data members

d.All of the above

e. None of these

9. Reference

What is the output of this program?

a. compilation error

b. 10

c. 30

d. 0

e. None of these

0 0
Add a comment Improve this question Transcribed image text
Answer #1

I have answered the first Question among many Questions posted. Please re-post for the other Questions.

Q1. Answer)

The BST after inserting 7, 3, 11, 1 , 5, 9, 13:

The traversals are as follows:

In Order Traversal: 1 3 5 7 9 11 13

Pre Order Traversal: 7 3 1 5 11 9 13

Post Order Traversal: 1 5 3 9 13 11 7

Thus all of the above are true.

d. All of the above

Add a comment
Know the answer?
Add Answer to:
HELP OBJECT ORIENTED PROGRAMMING QUESTIONS 1. Binary Search Tree Insert the following sequence: 7, 3, 11,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT