473,666 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

need help on a data structure problem

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.
Feb 2 '07 #1
3 1825
Dongsheng Ruan wrote:
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!

--
Feb 2 '07 #2
"Dongsheng Ruan" <ru**@jcmills.c omwrites:
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.

--
\ "As we enjoy great advantages from the inventions of others, we |
`\ should be glad to serve others by any invention of ours; and |
_o__) this we should do freely and generously." -- Benjamin Franklin |
Ben Finney

Feb 2 '07 #3
On 2007-02-02, Ben Finney <bi************ ****@benfinney. id.auwrote:
"Dongsheng Ruan" <ru**@jcmills.c omwrites:
>Not quite related with Python. But my Data Structure course is
experiemente d 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.
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'.

--
Neil Cerutti
It isn't pollution that is hurting the environment; it's the impurities in our
air and water that are doing it. --Dan Quayle
Feb 2 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1650
by: Alexandre MELARD | last post by:
Hi, My name is alexandre, I am 4th year student at the Napier university of edinburgh. I am finishing my year and do a presentation of my honours project next wednesday (the 5th of May). I am doing a project of data mining, and I run a mysql database to store my data. the database structure:
7
6491
by: Aleem | last post by:
I need help in writing a stored procedure on SQL Server 2000. Basically the stored procedure's primary task is to generate invoice records and insert the records in a invoice table. In order to generate the invoice records, I have an initial table which are basically Day Records. The task that I would like to complete is to select all records from that initial table and I guess put them into a temp table. Now that i have my temp table, I...
1
1400
by: saleem | last post by:
Dear friends, I am working on the problem which deals with the data management of requests and how should we match the responses for the requests to compare the correct Response. my problem is like this, say I am intermediary node between "m" and "n" nodes . n nodes send any of the "p"type of requests to any one of the "m" nodes on the other side. I have to forward the requests to
2
1383
by: Bob Heitzman | last post by:
I need to store data in, update, and read data from an XML file. An INI structure worked fine: a= 123 b= xyz c= etc
8
2736
by: skumar434 | last post by:
i need to store the data from a data base in to structure .............the problem is like this ....suppose there is a data base which stores the sequence no and item type etc ...but i need only the sequence nos and it should be such that i can access it through the structure .plz help me .
5
3361
by: Y2J | last post by:
I am working through this book on C++ programming, the author is speaking of using linked lists. He gave and example which I found confusing to say the least. So I rewrote the example in a way that I could better understand the concept, he was trying to convey to me. I ran my own example and it crashed and burn "what a surprise!" : (. I ran the authors example out of the book and quess what, it crashed also, : 0. I ran them both on my...
1
3324
by: rllioacvuher | last post by:
I need help with a program. I have implemented that following header file with an unordered list using one array, but i need to be able to use an ordered list and 2 arrays (one for the links and one to use as an index to the freearray cells). Here is the exact problem specifications: Create an ordered list template class named OLType to implement an ordered list with operations of insert, remove, print, empty, full, size. The storage...
4
2539
by: =?Utf-8?B?UHVjY2E=?= | last post by:
The function that I'm trying to call through DLLImport has a parameter that has a C code's vector's Itrator to a structure. I Have marshalled the structure in C# but how do I do the C type vector's Iterator in C#? The problem is in the next line and the rest of the code is just additional information on what I'm doing. Thanks. CUnityDS.DE_ERRORS errcode = CUnityDS.LibWrap.EncodeAsnUser(ref blob, userContextData); //In & out...
2
3977
by: jehugaleahsa | last post by:
Hello: I have a bunch of related items that are either parents, children or not directly related to each other. In my case, I have a bunch of database tables joined with foreign keys. Another example would be a family tree. I would like to take a flat list of these items and build the hierarchy. So, in other words, I would like to take one element and figure out its relationship to the other items. When I am all done, I
0
8443
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8356
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8781
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7385
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6192
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4366
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2769
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.