Question

THESE ARE TRUE/FALSE The best-time complexity for insertion sort is O(nlogn). The worst-time complexity for bubble...

THESE ARE TRUE/FALSE

  1. The best-time complexity for insertion sort is O(nlogn).

  1. The worst-time complexity for bubble sort is O(nlogn).

  1. A linked structure consists of nodes. Each node is dynamically created to hold an element. All the nodes are linked together to form a list.

  1. The time complexity for searching an element in a binary search tree is O(logn)

  1. The time complexity for inserting an element into a binary search tree is O(logn).

  1. In an AVL tree, the element just inserted is always at the leaf.

  1. Every object has the hashCode() method.

  1. If two strings are equal, the two strings have the same hashCodes.

  1. 1 << 2 is 4.

  1. The separate chaining scheme places all entries with the same hash index into the same location, rather than finding new locations.
1 0
Add a comment Improve this question Transcribed image text
Answer #1

1. False, Insertion sort sort one element at a time. Best time complexity measures when the list is already sorted. Best time complexity of insertion sort is O(n)

2. False, Bubble sort swaps adjacent elements to get sorted order. Best time complexity of bubble sort is O(n)

3. True, linked list is a data structure which connects nodes to form a sequence.

4. False, Binary search tree is a binary tree in which left child is less than parent and right child is greater than parent.To search element in binary search tree, we need to traverse the whole tree. Therefore, time complexity is O(h); h is the height of tree.

5. True, AVL Tree is a self balancing tree which has balancing factor of 1, 0, -1. New nodes are inserted at leaf node.

6.True, HashCode function returns hash value of the object in integer value. If two strings are equal , same hash value will be returned.

7.True, Separate chaining is a collision resolution technique which uses linked list. In separate chaining two elements can have same hash value.

Add a comment
Know the answer?
Add Answer to:
THESE ARE TRUE/FALSE The best-time complexity for insertion sort is O(nlogn). The worst-time complexity for bubble...
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
ADVERTISEMENT