Two Laptop Bag*
The moose likes Beginning Java and the fly likes Self-Organizing Vector Move-To-Front Reordering Algorith Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Self-Organizing Vector Move-To-Front Reordering Algorith" Watch "Self-Organizing Vector Move-To-Front Reordering Algorith" New topic
Author

Self-Organizing Vector Move-To-Front Reordering Algorith

Roger Sanchez
Greenhorn

Joined: Jun 23, 2003
Posts: 16
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
Joe Pluta
Ranch Hand

Joined: Jun 23, 2003
Posts: 1376
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
 
GeeCON Prague 2014
 
subject: Self-Organizing Vector Move-To-Front Reordering Algorith