473,387 Members | 1,492 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,387 software developers and data experts.

revision algorithms

I am looking for an algorithm to implement a revision system. The data
is quite simple. There is a array of objects. New objects can be
added, objects can be deleted, and objects can be moved around in the
array.

I am looking for an efficient way to look at two versions of this list,
capture what changed, and be able to return to init state.

Can anyone point me to any good examples?

Feb 23 '06 #1
1 1453
herc wrote:
I am looking for an algorithm to implement a revision system. The
data is quite simple. There is a array of objects. New objects can
be added, objects can be deleted, and objects can be moved around in
the array.

I am looking for an efficient way to look at two versions of this
list, capture what changed, and be able to return to init state.


This is somewhat off-topic, but if I understand you correctly you're looking
for a way to store an array along with history difference information which
allows you to revert to any previous version. The simplest way to do this is
to keep a log of each action (add, remove, or move) and go through the log
backwards reversing the actions. Another way is to switch to a persistent
(functional) data structure, such as a persistent red-black tree - then you
could simply keep a reference to the root for each previous version that you
want to return to, and it would remain valid. I don't know of an existing
functional red-black tree implementation in C# though.

Describing differences is trickier, and usually involves first computing the
two versions and then comparing them somehow, such as by using the
Levenshtein distance algorithm to find the minimal set of element additions
and removals to get from the old to the new version. Here's a C#
implementation of the Levenshtein distance algorithm (you would just need to
modify it to deal with your array elements instead of strings):

http://www.merriampark.com/ldcsharp.htm

Hope this helps.
--
Derrick Coetzee, MCAD, MSFT (Speech Server)
This posting is provided "AS IS" with no warranties, and confers no
rights.
Feb 24 '06 #2

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

Similar topics

0
by: Richard Joseph | last post by:
I am looking for a method to keep track of revisions. I have developed many engineering database applications. Keeping tack of changes to fields is often required and I have never implemented a...
0
by: chris-list-python | last post by:
I'm using rcslib.py to massage an RCS repo. The code uses a "name_rev" object which acts two ways: 1. if it's a string, represents the head version of the file 2. if a tuple (name, rev)...
1
by: Burghew | last post by:
Hi All, I have 2 fields called document & Revision which contains the titles for the documents to be stored in the databse it gets filled up as the user enters them and the revison numbers...
4
by: Burghew | last post by:
Hi All, I have 2 fields called document & Revision which contains the titles for the documents to be stored in the databse it gets filled up as the user enters them and the revison numbers...
13
by: IndianaJonesWB | last post by:
I have an Access Project as a front end for a SQL DB. I have a master copy and distribute copies of it to my other users. I would like to display a revision count on the first Main Form so that...
2
by: Mark | last post by:
In the AssemblyInfo.cs page of a ASP.NET project, there is a defaulted property of: It's my understanding that this indicates a Major Version of 1, a Minor Version of 0, and a Build and...
4
by: Pietro | last post by:
Thanks for the last answer, but now how can i restart the count of the Build and Revision numbers of a dll in VS.Net. Thanks Pietro
4
by: johnk | last post by:
I have a table of items, with revision numbers. I need to extract the items with highest revision number. The items may be listed several times and I don't know what the highest revision number...
6
by: Jean-François Michaud | last post by:
Hello, I'm having trouble figuring something out. I have to reproduce a PDF output and in the original document, "revision indicators" are used to show which parts of the document have changed...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.