Sign in to follow this  
Ultraseamus

Algorithm Analysis

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this