Skip to main content

TailedLinkedList.map

Maps the current TailedLinkedList to a function. Returns a new TailedLinkedList

Usage

map(func: Callable[[Any], Any])

Parameters:
      func : Callable
            A function to map the values by

Returns:
      TailedLinkedList
            A new TailedLinkedList containing the mapped values

Example

from jellybeans.structures import TailedLinkedListLL1 = TailedLinkedList([10, 3, 7, 29])print(LL1.map(lambda x:2*x)) # 20 => 6 => 14 => 58