Question

7. (20 points) Assume L is a list, and assume that int n=L length() returns the number of elements in the list, and Bubblsort
1. Assume that the values 1 through 8 are stored in a self organizing list, initially in increasing order. For each of the th
Comments
    Answer #1

    7) a. \Theta(n2 logn)

    Explanation: We know that Bubble Sort worst case time complexity is O(n2)
    for loop will take log n time and everytime it will swap i elements and in worst case it will take O(n2 logn)

    7) b. \Theta(n4)

    Explanation: We know that Bubble Sort worst case time complexity is O(n2)
    for loop will take n2 time and everytime it will swap i elements and in worst case it will take n2 x n2 = n4


    Thanks, PLEASE COMMENT if there is any concern.

    For 1. Please provide more data , because we don't know what was learned in class

    Add a comment
    Know the answer?
    Add Answer to:
    7. (20 points) Assume L is a list, and assume that int n=L length() returns the number of element...
    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