Skip to main content

DoublyLinkedList.filter

Filter the DoublyLinkedList based on a function. Returns a new DoublyLinkedList

Usage

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

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

Returns:
      DoublyLinkedList
            A new DoublyLinkedList containing the filtered values

Example

from jellybeans.structures import DoublyLinkedListLL1 = DoublyLinkedList([10, 3, 7, 29])print(LL1.filter(lambda x:x>9)) # 10 => 29