Re: Efficient Vector Comparison



On Thu, 28 Jun 2007 16:48:49 +0800, Yao Qi <qiyaoltc@xxxxxxxxx> wrote:


In our program, we will compare every two vectors. In current
implementation, we compare every element of that vector until we get the
comparison result. It is not any more efficient way to do this?

b.t.w the length of vector is variable.

Your description is inadequate. Here are questions you need to answer.

1. What kind of comparison result do you need? Is a equal/not equal result
satisfactory, or do you need a less than/equal/greater than result based on
some ordering, or do you need to know the first element at which the two
vectors differ, or what?

2. When you say "we will compare every two vectors" what do you actually
mean by that? Does that mean that you have a set of vectors and that you
will do a comparison on every pair from the set? If not, what do you mean?
There are a number of methods for managing and classifying set of data
elements (vectors in your case) such as hash tables and patricia trees.
They might be relevant or might not. There is no way of knowing from your
description.



.



Relevant Pages

  • Re: Efficient Vector Comparison
    ... we will compare every two vectors. ... or do you need to know the first element at which the two ... elements such as hash tables and patricia trees. ...
    (comp.programming)
  • Re: Sorting a list
    ... John Salerno writes: ... first element of each tuple? ... list.sort will ask the elements of the list to compare ... Ben Finney ...
    (comp.lang.python)
  • Re: anonymous functions
    ... Kim Russell wrote: ... Is it possible to compare each ... Which is first element of *l* that is a power of 2 and is at least as big as *x*? ...
    (comp.lang.lisp)
  • Re: o remove the occurrence of the first element in a list
    ... in fact does I want to compare the first element of the list with all ... cons, append. ...
    (comp.lang.scheme)