Go to Post After the norovirus outbreak at VCU, we had our entire team sterilized. Oh, wait, that doesn't sound right... - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 25-07-2010, 13:45
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
comparing integer lists

I have two small arrays of integers. (I don't expect more than 16 elements in each array) No integer occurs more than once in an array. Integers are sorted from least to greatest, though they are not necessarily consecutive.

What's an efficient way to diff them, so I get the elements in each array that aren't in the other?
(I do want two resulting arrays, for the elements that were only in array 1, and only in array 2)

The simple way I thought of was to iterate through the first away searching for matching elements in the second array. If one is found, both elements are deleted. The remaining arrays are the elements that were only in each array.
__________________
-- Marshal Horn

Last edited by kamocat : 25-07-2010 at 13:52.
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Should we really be comparing Breakaway to soccer? XaulZan11 Rules/Strategy 9 13-02-2010 15:22
Merging/Comparing LabVIEW VIs Terry Sherman NI LabVIEW 7 30-08-2009 10:30
Comparing Sensor Readings in NQC ZACH P. Programming 5 30-08-2003 17:33
Integer Number powercat Programming 2 18-02-2003 11:26
Spreadsheet comparing ALL First motors Nuts4FIRST Motors 0 08-01-2002 09:20


All times are GMT -5. The time now is 03:26.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi