Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What is the time complexity to insert an element into a heap with N elements? A. O(N) B. O(1) C. O(N2) D. O(logN) QUESTION 9

image text in transcribed
image text in transcribed
image text in transcribed
What is the time complexity to insert an element into a heap with N elements? A. O(N) B. O(1) C. O(N2) D. O(logN) QUESTION 9 In a Huffman tree, the item with the lowest frequency of occurrence will have the code. A. shortest B. all one C. longest D. all zero Set s= new HashSet(); s.add ("hello"); s.add ("bye"); Set t = new HashSet(); t. add ("123") ; t.add ("456") t.add ("bye") ; saddA11(t); A. \{"hello", "bye", "123", "456", "bye"\} B. \{"hello", "bye", "123"\} C. \{"hello", "bye", "123", "456"\} D. \{"hello", "bye"\} QUESTION 11 What is the time complexity to search a key from a HashMap with N elements? AO(N2) B. O(I) C. O(N) D. O(logN) What is the time complexity to search a key from a TreeMap with N elements? AO(N2) B. O(N) C. O(logN) D. O(1) QUESTION 13 What is the time complexity to sort an array with N random numbers using bubble sort? A. O(N) B. O(N2) C. O(1) D. O(NlogN) QUESTION 14 What is the time complexity to sort an array with N random numbers using Merge sort? AO(N2) B. O(N) C.O(1) D. O(NlogN)

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

Database Fundamentals Study Guide

Authors: Dr. Sergio Pisano

1st Edition

B09K1WW84J, 979-8985115307

More Books

Students also viewed these Databases questions