Monday, 15 June 2015

c# - Algorithm for determining changes between 2 lists as quicky as possible? -



c# - Algorithm for determining changes between 2 lists as quicky as possible? -

i have projects.

these projects downloaded site site via api.

i download projects site a.

there matching json objects on side. of import need this.

list (my site) needs synced list b (their site).

i have manually sync due api limits.

so there projects , attributes:

given list , list b. fast algorithm that:

if missing object b, add together it. if b no longer contains element found in a, remove a. if attribute in b != attribute in object a, update object in a.

i sense way lot of o (n^2). there way improve o(n^2) on of this?

thanks

using hashset implementation check "contains" status should give average complexity of less n^2

c# asp.net

No comments:

Post a Comment