What is a permuted index?

This is a discussion on What is a permuted index? within the C++ Programming forums, part of the General Programming Boards category; I have an exercise to do, but i don't understand what the question is asking me: Design and impliment a ...

  1. #1
    The Earth is not flat. Clyde's Avatar
    Join Date
    Mar 2002
    Posts
    1,420

    What is a permuted index?

    I have an exercise to do, but i don't understand what the question is asking me:

    Design and impliment a program to produce a permuted index. A permuted index is one in which each phrase is indexed by every word in the phrase. So, given the following input,

    Code:
              The quick brown fox
              jumped over the fence
    the output would be


    Code:
                  The quick       brown fox
           jumpted over the       fence
            The quick brown       fox
                                  jumpted over the fence
                    jumpted       over the fence
                        The       quick brown fox
               jumpted over       the fence
                                  The quick brown fox
    I have no idea what the question is asking me, is a permuted index just a vector of strings, each string corresponding to a word in the phrase? If so, i fail to see how that relates to the output they want.

    Thanks in advance.
    Last edited by Clyde; 04-12-2002 at 06:33 AM.

  2. #2
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    A permutation is when you have a certain number of elements and arrange them in every combination possible.

    ie:
    Code:
    A B C would  be:
    
    A B C
    A C B
    B A C
    B C A
    C A B
    C B A
    
    I'm not sure about this one, but I think it can contain
    combinations which does not have every element in it too:
    
    A
    B
    C
    A B
    B A
    B C
    C B
    A C
    C A
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  3. #3
    The Earth is not flat. Clyde's Avatar
    Join Date
    Mar 2002
    Posts
    1,420
    I see, but in the example they give, the output doesn't seem to have every possible combination of the words given in the input.

    I still don't quite see what they are asking me to do.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Permuted Index Help
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 03-27-2009, 11:03 PM
  2. What's a permuted index?
    By dnguyen1022 in forum C++ Programming
    Replies: 4
    Last Post: 01-28-2009, 02:55 AM
  3. 20q game problems
    By Nexus-ZERO in forum C Programming
    Replies: 24
    Last Post: 12-17-2008, 04:48 PM
  4. Function to check memory left from malloc and free?
    By Lechx in forum C Programming
    Replies: 4
    Last Post: 04-24-2006, 05:45 AM
  5. file index update error
    By daluu in forum C Programming
    Replies: 1
    Last Post: 04-28-2003, 02:47 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21