need help on a data structure problem

D

Dongsheng Ruan

Not quite related with Python. But my Data Structure course is experiemented
on python and there is no data structure group, So I have to post here:

Write a procedure (in pseudocode!) to increase the number of buckets in a
(closed) hash table. Analyze its time and space complexity.
 
T

Tom Plunket

Dongsheng said:
Not quite related with Python. But my Data Structure course is experiemented
on python and there is no data structure group, So I have to post here:

Write a procedure (in pseudocode!) to increase the number of buckets in a
(closed) hash table. Analyze its time and space complexity.

What is the question about this problem that you would like to have
answered? Certainly you don't want us to actually give you the answers
to your homework?!?

Here's some Python code to get us started with the discussion:

class HashTable:
def __init__(self):
self.buckets = [ [] ]

@staticmethod
def Hash(object):
return 0

def InsertItem(self, item):
self.buckets[Hash(item)].append(item)

The more I think about it, the more I realize you could probably just
cut'n'paste that code and that should suffice for your answer! Good
luck in Computer Science!


-tom!

--
 
B

Ben Finney

Dongsheng Ruan said:
Not quite related with Python. But my Data Structure course is
experiemented on python and there is no data structure group, So I
have to post here:

Better, you should discuss it in your class, with your teacher.
 
N

Neil Cerutti

Better, you should discuss it in your class, with your teacher.

Also: comp.algorithms is the usual Usenet place for discussion of
algorithms and data structures.

However most of the talk there is pretty high-falutin'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top