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
  • The time-complexity of searching an AVL tree is in the worst case and in the average...

    The time-complexity of searching an AVL tree is in the worst case and in the average case. On), On) O(logot). O(log O ON), C(n) 0(), O(log) Question 16 2 pts The time-complexity of searching a binary search tree is in the worst case and in the average case (1), O(log) O(logn), O(log,n) On), On) 001), 001)

  • 1. What is the worst case time complexity of insertion into a binary search tree with...

    1. What is the worst case time complexity of insertion into a binary search tree with n elements? You should use the most accurate asymptotic notation for your answer. 2. A binary search tree is given in the following. Draw the resulting binary search tree (to the right of the given tree) after deleting the node with key value 8. 10 3. You have a sorted array B with n elements, where n is very large. Array C is obtained...

  • Match each problem to the time complexity class it likely belongs to: 1. O(1): Constant 2....

    Match each problem to the time complexity class it likely belongs to: 1. O(1): Constant 2. O(n): Linear 3. O(n!): Factorial 4. O(logn): Logarithmic 5.O(n2): Quadratic 6. O(n3): Cubic OPTIONS: a. Find an element in an unsorted array b. Shortest path between two nodes in a graph c. Matrix multiplication d. Generate permutations of a string e. Add an element to the front of a linked list f. Find an element in a binary search tree

  • Assume a hash table is implemented using chaining with buckets implemented using sorted linked lists. What's...

    Assume a hash table is implemented using chaining with buckets implemented using sorted linked lists. What's the worst-case time complexity of inserting a data item? (n is the size of data) Oin None of these Oina) O(nLogin) O 0(1) D Question 22 2 pts Assume a hash table is implemented using chaining with buckets implemented using binary search trees. What's the average-case time complexity of searching for a data item? Assume the size of data, n, is not much larger...

  • Instead of using a linked list to resolve collisions, as in separate chaining, use a binary search tree. That is, create...

    Instead of using a linked list to resolve collisions, as in separate chaining, use a binary search tree. That is, create a hash table that is an array of trees. To display a small tree-based hash table, you could use an inorder traversal of each tree. The advantage of a tree over a linked list is that it can be searched in O(logN) instead of O(N) time. This time savings can be a significant advantage if very high load factors...

  • 8 Sorting Algorithms: Bubble, selection, insertion, quick, merge, bucket, radix, counting. 1. A..Which of the above...

    8 Sorting Algorithms: Bubble, selection, insertion, quick, merge, bucket, radix, counting. 1. A..Which of the above sorting algorithms does TimSort use? 2. Which of the above algorithms sort a REVERSE ORDER list in O(n2 ) (worst case)? 3. Which of the above algorithms sort a REVERSE ORDER list in O(nlogn) (worst case)? 4. Which of the above algorithms sort an ordered list , a reverse ordered list, and a random list (all three) in 0(nlogn) (worst case)? 5. Which of...

  • for java 4. Instead of using a linked list to resolve collisions, as in separate chaining, use a binary search tre...

    for java 4. Instead of using a linked list to resolve collisions, as in separate chaining, use a binary search tree. That is, create a hash table that is an array of trees. To display a small tree-based hash table, you could use an inorder traversal of each tree. The advantage of a tree over a linked list is that it can be searched in O(logN) instead of O(N) time. This time savings can be a significant advantage if very...

  • Big O SECTION List appropriate Worst Case Big O Notation under the different algorithms or data...

    Big O SECTION List appropriate Worst Case Big O Notation under the different algorithms or data structure operations. Choose from right column and place under left column. Right column can be used more than once or not all. O(1) O(n) O(n ^ 2) O(log n) Time Efficiency A. dequeue() a Node 1,000,000 element Linked List - Queue Implementation B. Traversing a Doubly Linked List from the Tail Node to the Head Node C. Traversing every element in Stack with array...

  • fill in the blank Binary Search Tree AVL Tree Red-Black Tree complexity O(log N), O(N) in...

    fill in the blank Binary Search Tree AVL Tree Red-Black Tree complexity O(log N), O(N) in the worst case O(log N) O(log N) Advantages - Increasing and decreasing order traversal is easy - Can be implemented - The complexity remains O(Log N) for a large number of input data. - Insertion and deletion operation is very efficient - The complexity remains O(Log N) for a large number of input data. Disadvantages - The complexity is O(N) in the worst case...

  • Puodace a char showing the number of moves required to solve the Towers of Hanoi puzle using t 30...

    Puodace a char showing the number of moves required to solve the Towers of Hanoi puzle using t 30. What is an execution frame? What is an activation record? What is contained in it? 31. Write a recursive Java method that computes the factorial of a number 2. Linear search may require up to comparisons while binary search will only require roughly comparisons 33. Sort sorts a list of values by repetitively putting a particular value into its final, sorted,...

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