Hi,
Consider a map, with N bus stations, and there are total L bus lines
operating on this set of stations
1. Each line follow a particular path, it might not be symmetric (i.e.
the path from placeA=> placeB might be different from placeB to
placeA)
2. Some statations are shared by several lin
W words in article. If we do not sort the words, it will take O(WT);
if we sort words in each atilcle, it is O(Wlg(W)+Tlg(W)); or maybe
hash is another choice, it takes O(W+T).
If T is small, just use O(WT) way. Otherwise, use sort or hash
instead.
Roy M wrote:
> Recently need to think of an eff
Recently need to think of an efficient way to exact terms from an
article, and do some processing on it, to make it simple, terms
translation
1. Given I have an article of 1000-2000 words, let the number of words
be W
2. I have a dictionary which consists of all term, let the number of
terms be T
you must do the following:
class vertex
{
public:
vertex *parent;
int value;
vertex()
{
parent = NULL;
value = rand();
}
~vertex();
}Array[10];
I want to construct a min priority queue to hold class objects
eg
class vertex
{
public:
vertex *parent;
int value;
vertex()
{
parent = NULL;
value = rand();