Skip to main content

DoublyLinkedList.map

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

Usage

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

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

Returns:
      DoublyLinkedList
            A new DoublyLinkedList containing the mapped values

Example

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