Algorithm complexity - remove and insert

  • (2 Pages)
  • +
  • 1
  • 2

17 Replies - 1150 Views - Last Post: 02 February 2015 - 11:50 AM

#16 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12800
  • View blog
  • Posts: 45,992
  • Joined: 27-December 08

Re: Algorithm complexity - remove and insert

Posted 02 February 2015 - 10:30 AM

Derive T(n) for the hash function based on the code you wrote. This is your homework and the goal is to learn complexity analysis. If you won't make an effort to derive T(n), I don't know how you expect to learn.

I can't be of any more help until you make this effort.
Was This Post Helpful? 1
  • +
  • -

#17 BenSalem   User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 22
  • Joined: 21-January 15

Re: Algorithm complexity - remove and insert

Posted 02 February 2015 - 11:48 AM

what is Derive?
like this? T(n)=n+m
n = number of times the loop in the hash function
m the number of linked list
Was This Post Helpful? 0
  • +
  • -

#18 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12800
  • View blog
  • Posts: 45,992
  • Joined: 27-December 08

Re: Algorithm complexity - remove and insert

Posted 02 February 2015 - 11:50 AM

No... The function T(n) gives you a function for the number of steps the insert() method should take, where n is the size of the input parameter (the String you are adding to the hash table).

Not to be rude- but if you're doing complexity analysis, I am assuming you know something about complexity. Where are your course notes and book?

In looking at this thread, it really seems like you're waiting for me (or someone else) to do the work for you. So I'm going to close this thread. If you are really clueless on this subject, you should either see your professor in office hours or consider dropping the class.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2