Programming Forums
User Name Password Register
 

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

Reply
 
Thread Tools Display Modes
Old Jan 10th, 2006, 11:57 PM   #11
nindoja
Programmer
 
Join Date: Jun 2005
Posts: 92
Rep Power: 4 nindoja is on a distinguished road
Use strings or character arrays, your choice. Loop through each strand, comparing each base one by one. Then:

1) If the two bases are different, add the base to the diff_base string.
2) If the two bases are the same, and add a '0' to the diff_base string.

Then you can see where the differences are by outputting the diff_base string, and all non-zero values are differences.
nindoja is offline   Reply With Quote
Old Jan 11th, 2006, 2:46 AM   #12
Klipt
Hobbyist Programmer
 
Join Date: Dec 2005
Posts: 118
Rep Power: 0 Klipt is an unknown quantity at this point
Quote:
Originally Posted by Ooble
Ow, my head.

A very simple comparison would loop through and simply compare each character. However, if in one strand, the data was offset by a single base, it'd all be flagged as different, even though only one real change needs to be made. More advanced comparisons would confuse me though, so I'm going to leave that to you.
For a more thorough comparison I'd recommend edit distance:
Quote:
Originally Posted by Wikipedia
edit distance between two strings is given by the minimum number of operations needed to transform one string into the other, where an operation is an insertion, deletion, or substitution.
although in this case the 'differences' will be a whole sequence of insertions, deletions, and substitutions, so I'm not sure how you'd output that ... it may be overkill for your project.
Klipt 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 12:42 AM.

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