473,378 Members | 1,436 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

performance of Red-black trees and splay trees ie.. insert ,search,delete etc

Hi friends .............
this is a question regarding the data structures trees
Pleas post it if possible with in 2 days
I will thankful if some body could help doing this.
Operating system: windows xp
compiler : Dev c++
Question is as folllows :

Genaration of keys :
Assume that your keys are character strings of length 10 obtained by scannig a c++ program. If a string has less than 10 characters make it up to 10 characters by including an appropriate number of trailing *'s. On the other hand, if the current string has more than 10 characters, truncate it to have the first ten characters only.

What should the program take as input?
1. n: the initial number of insertion of distinct strings to be made for setting up
an initial search tree(Red black tree or spaly tree)
2. I: This is a decimal number from which a ternary string is to be generated (namely radic-3 representation of I) In this representation, assume that a 0
represent the search operation, a 1 represents the insert operation , and a2 represents the delete operation
3. N : number of operations to be performed on the data structure.
4. A c++ program from which the tokens are to be picked up for setting up and
experimenting with the search trees.

What should the program do?
1. Scan the c++ program and as you scan , insert the first n distinct strings
scanned into an initial search treee ( Red black tree or splay tree)
2. For each individual operation keep track of ::
a) Nurmber of probes (comparisions of two strigs of 10 characters each)
b) Number of pointer assignments ( a single rotation involves three pointer
assignments )
c) Number of single rotations and number of double rotations ( in case of red
black trees and splay trees)
d) Examining or changing the colour ( in a red-black tree)

Now, compute for the redblack tree and splay tree, the following:
1.Height of the search tree
2. total number of probes for all the operations
3. Average number of probes (averaged over all the operations ) for a typical
sucessful search, unsucessful search, insert and delete
4. Total number of pointer assignments
5. Total number of single rotations
6. total number of double rotations
7.Total number of each type of spaying steps (Zig, Zag, Zig-Zag, Zag-zig , Zag-Zag) in the case of splay trees.
8. Total number of recolurings in the case of Red black trees
Oct 4 '07 #1
2 2970
Meetee
931 Expert Mod 512MB
Hi,

Welcome to TSDN. This question looks like homework or assignment. Have you tried anything so far? Then paste it here. Also follow posting guidelines as TSDN is not the site to do homeworks or assignments. You can ask your perticular problem,errors or logical queries and we would be glad to help you then.

Kind regards
Oct 4 '07 #2
1.How to take a character input from another file ?
2.what is the command to retrieve this ?
Oct 5 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: David Jones | last post by:
Hi, I am trying to hunt down the difference in performance between some raw C++ code and calling the C++ code from Python. My goal is to use Python to control a bunch of number crunching code,...
133
by: Gaurav | last post by:
http://www.sys-con.com/story/print.cfm?storyid=45250 Any comments? Thanks Gaurav
6
by: James dean | last post by:
I am comparing performance of my own application with another microsoft product. Is there first of all any s/w that could measure the performance of a running application like Ms...
3
by: Thomas | last post by:
hi, - I use the datagrid without a real database, only to display my memory data and it works fine. - If I install the application at an other computer the datagrid doesn't work and disappear,...
5
by: John Richardson | last post by:
I've been bothered for some time about my DataGrid not populating my rows very quickly. I have about 10K rows loading into the grid. I create a datatable dt with 2 columns, an ID and a display. ...
29
by: Olaf Baeyens | last post by:
Because of historical reasons, I have both C# and C++ managed/unmanaged code mixed together in my class library. But I prefer to port code to C# since it compiles faster and the syntax is much...
3
by: Ryan Ternier | last post by:
I'm trying to improve the performance on an ASP.NET site we have created. On my test server running in debug mode, it will take me 5 seconds to load the page. On my Test server, in release mode,...
4
by: James Radke | last post by:
Hello, I am creating an owner draw listbox for a windows application. It is all working, except the performance is significantly slower than the standard listbox. Basically what I have done is...
2
by: badrbadr | last post by:
Hi, Today, I find a problem from an old Google Code Jam Contest. You can read the problem statement here : http://www3.sympatico.ca/red.zrari/problem.htm I solved the problem in 15 min (wow, c#...
1
by: warfi | last post by:
Anybody out there can please help me out finding some performance measuring tool for a .net application built in version 1.1.
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.