This week's book giveaway is in the OCAJP forum. We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line! See this thread for details.
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
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