# Self-Organizing Vector Move-To-Front Reordering Algorith

Roger Sanchez

Greenhorn

Posts: 16

posted 13 years ago

I am trying to solve the following problem in preparation for an exam I'm taking. Here it is:

"Suppose that a self-organizing vector has 7 elements , ABCDEFG initially in this order (A is the front element), and suppose that the vector is organized by the move-to-front reordering algorithm. Determine the order of elements after the lookup sequence GGDED."

Any help would be great.

Thanks,

Roger

"Suppose that a self-organizing vector has 7 elements , ABCDEFG initially in this order (A is the front element), and suppose that the vector is organized by the move-to-front reordering algorithm. Determine the order of elements after the lookup sequence GGDED."

Any help would be great.

Thanks,

Roger

Joe Pluta

Ranch Hand

Posts: 1376

posted 13 years ago

I don't have a clue what all the terms mean, but my common sense approach tells me that it means that every time you look something up, it ends up in the front. So:

ABCDEFG

Lookup (G), put (G) in the front: GABCDEF

G again: GABCDEF (already in front)

Lookup D: DGABCEF

Lookup E: EDGABCF

Lookup D: DEGABCF

Not sure, but that looks right to me.

Joe

ABCDEFG

Lookup (G), put (G) in the front: GABCDEF

G again: GABCDEF (already in front)

Lookup D: DGABCEF

Lookup E: EDGABCF

Lookup D: DEGABCF

Not sure, but that looks right to me.

Joe