Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I Understand that I have posted many questions but this is my last available Question and I would really appreciate a lot if all the

I Understand that I have posted many questions but this is my last available Question and I would really appreciate a lot if all the questions can be answered

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

PART A-OBJECTIVE QUESTIONS [10 marks) Part A consists of 10 objective questions. Choose the correct answer, and write your answer in the answer sheet provided. Each question carries 1 mark. 1. If an array consists of 1000 integers, what is the maximum number of comparisons against the target item that might be performed by binary search? A. 1000 B. 500 C. 10 D 1 2. What is the worst case runtime complexity of searching for an item in an unsorted array using linear search? A. O(log. n) B. O(n) C. O (1) D. 0 (0) 3. Suppose that p and a point to adjacent nodes (p before a) in a linked list of nodes defined by class nodeType. What is the missing statement so that a new node is inserted between p and q. class node Type { public: int info; nodeType *next; 1 node Type head, *p, *, *newNode; newNode = new node Type: // Missing statement p->next = newNode; A B. C. D. q=newNode->next; newNode->next=g; p->next=; p=newNode->next; 4. In folowing linked list what is the output of portion code? struct node { int data; struct node* next; }; B C D IT 1 h q AA cout cout cout cout h->next->next->next>data p->next->data a->data p->next->next->data A EBCD B. ECDD C. DCDD D. DBDE 5. Which of the following statements are TRUE about stack? i. A stack is a linear list data structure. ii. The size of stack implemented using array is flexible. An item can be pushed and popped dynamically 111. Stack can be implemented using array and linked list. iv. A stack has Last In First Out (LIFO) property. i, ii, and iv C. i, iii, and iv. i, ii, and iii D. All above B. 6. What will be the initial value of top when an array based stack is created ? A. 0 C. -1 B. D. false true 7. Which of the following scenario is an example of array-based queue? A. An Address Resolution Protocol table stores a mapping of IP and MAC addresses, in which least used mapping will be deleted when the table is full. B. A mobile node that join a network requests an IP address from an Access Point, but the request will be rejected when all IP addresses have been allocated. 2 C. Each network application that runs on a computer will be assigned with next available network application port numbers, ranges between 1024 - 49151. D. For online purchase, a system will stamp all requests based on their time of arrival on the server. The system will display the balance of phone stock while "Sold out" message will be displayed when all units are sold to first 500 customers, who successfully checkout of the system. 8. All the following statement are TRUE for circular queue using linked-list. EXCEPT A. Only one external pointer that point to rear node is required. B. In the case of an empty list, the value of an extemal pointer is NULL C. It is possible to have two external pointers that point to front and rear node D. It is possible for an extemal pointer to point to itself. 9. Which of the following traversal type would print all node values of binary search tree in sorted order? A. Preorder B. Postorder C. Inorder D. None of the above 10. In Figure Al below. x is the root of a tree. What is the OUTPUT if printTree (x) is executed ? void printTree (Binary Tree *t) if (c != NULL) { cout data; printTree (t->left); printTree (t->right); } 3 1 10 8 2 Figure Al: Binary Search Tree A B. 4 31 29 7 6 8 10 2 1 3 6 8 7 10 9 4 C. 1 2 3 4 6 7 8 9 10 D. 41 3 2 7 9 6 10 8 3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Describe reviewing applications and rsums.

Answered: 1 week ago