Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 17th, 2006, 8:29 PM   #1
sri_kool
Newbie
 
Join Date: Apr 2006
Posts: 1
Rep Power: 0 sri_kool is on a distinguished road
some one help

can some one write this program in java for me

The goal of this programming assignment is to study details of implementations of an example
of dynamic dictionary: Skip-lists. The purpose of this programming assignment is to implement a class SkipList that supports
basic operations on skip-lists. For simplicity, you may assume that all nodes in the lists will store numbers of type int.
Multiple items with the same key should be allowed. Since to implement a list you will need a list
structure that needs “nodes,” you also should implement a class node.
(Your Skip-list should allow lists with up to N = 1000000 keys.)
Functions used in the class SkipList:
1. create: creates an empty Skip-list.
2. isEmpty: returns true if and only if the Skip-list is empty.
3. size: returns the size of the Skip-list, that is, the number of elements in the Skip-list.
4. search(key): returns TRUE if there is an element with key key in the Skip-list; if there
is none, then it returns FALSE.
5. insert(key): inserts into the Skip-list a new element with the key key.
6. delete(key): deletes from the Skip-list an element with the key key; if no such an
element is stored in the Skip-list, then no change to the data structure should be done; if
more than one elements with given key is in the Skip-list, then only one (any) of these
elements should be deleted. (Note for C++ programmers: since delete is a restricted keyword
in C++¡ you are allowed to rename this function to remove(key). However, if you do so, you must
explicitly state this in the comments before your program!)
7. display: displays the Skip-list on the standard output. The format in which the Skip-list
should be displayed is as follows:
• the first line contains the number of lists in the Skip-list (using the terminology from
the textbook, if the lists are denoted by S0, S1, . . . , Sh, then the number should be equal
to h + 1)
• the next h + 1 lines:
2
⊲⊳ the ith line contains the list Si in the Skip-list in the following format:
◮ number i (where i is the number of the list) followed by the colon (punctuation
mark
◮ number of elements in the list (not including −∞and∞) followed by the colon
◮ the keys of the elements from the ith list separated by commas
◮ the line should terminate with a dot (.).
For example, the Skip-list from Figure 3.46 from the textbook should be displayed as follows:
6
0: 10: 12, 17, 20, 25, 31, 38, 39, 44, 50, 55.
1: 7: 12, 17, 25, 31, 38, 44, 55.
2: 4: 17, 25, 31, 55.
3: 3: 17, 25, 55.
4: 1: 17.
5: 0:.
sri_kool is offline   Reply With Quote
Old Apr 17th, 2006, 8:31 PM   #2
Eric the Red
Hobbyist Programmer
 
Eric the Red's Avatar
 
Join Date: Feb 2006
Posts: 214
Rep Power: 0 Eric the Red is an unknown quantity at this point
So what work do u have so far?
__________________
Death smiles at us all. All a man can do is smile back.
Eric the Red is offline   Reply With Quote
Old Apr 17th, 2006, 8:35 PM   #3
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 770
Rep Power: 3 Jimbo is on a distinguished road
Quote:
Originally Posted by sri_kool
can some one write this program in java for me
No, we don't hire out our services (at least from this forum). You might try the Job Offers forum, or then again, do your own work.
Jimbo is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:11 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC