Jump to content
  • Advertisement
Sign in to follow this  
Ultraseamus

Algorithm Analysis

This topic is 4570 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am studying for my Algorithm Analysis class, i need to fill in this table: Operation: Finding a particular item Finding the ith element Finding the maximum item Adding an item Deleting a particular item for: Unsorted array, Sorted array, Unsorted linked list, Sorted linked list the different levels of compelxcity are: O(k) O(lg N) O(N) O(N lg N) O(N2) O(N3) O(Nk) O(2N) For all of these i am looking for the worst case. Finding item,Finding ith element,Finding maximum item,Adding an item,Delete item So far here is what i have, in the order listed above: Unsorted array : O(N),O(k),O(N),O(k), O(N) Sorted array : O(lg N),O(k),O(k),O(N), O(N) Unsorted linked list : O(N),O(N),O(N),O(k), O(k) Sorted linked list : O(N),O(N),O(k),O(N), O(k) Sorry if this is hard to read, i am not sure how to put a chart into a post. If anyone could point out any mistakes, or confirm my results that would be great, Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Looks OK, assuming that "deleting a particular item" doesn't require to find it first.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!