Skip to main content

LinkedList.map

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

Usage

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

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

Returns:
      LinkedList
            A new LinkedList containing the mapped values

Example

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