Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Self-Organizing Vector Move-To-Front Reordering Algorith

 
Roger Sanchez
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1376
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic