Question: How to index a list by a list of indices?

Hello

I have a couple of large lists that will be further processed.  One of the steps is to index a list using another list (a list of indices).  A short example will be something like

L:=[2,1,4,3,7,6,8,3,4,5];
ind:=[2,2,3,3,5,6,7,1,4,10];

The solution 

L1:=L[ind]:

does not seem to be a good choice since it takes longer than the following solution

 

L1:=Threads:-Map(w->L[w],ind):

 

Since I am not a Maple expert, it is very likely that is a faster solution.   

 

Many thanks

 

Please Wait...