Question: Write this function given the template below for linked lists in C++ with the given requirements: Given implementation of Linked list that can be helpful

Write this function given the template below for linked lists in C++ with the given requirements:

Write this function given the template below for linked lists in C++

Given implementation of Linked list that can be helpful for writing function:

with the given requirements: Given implementation of Linked list that can be

TODO function: filter-leg description: removes all elements of the given list (lst) which are less than or equal to a given value (cutoff) A list containing the removed elements is returned. examples: EX1: 1st: [4, 9, 2, 4, 8, 12, 7, 3] cutoff: 4 after call: 1st: , 8, 12, 71 returne d list:[4, 2, 4, 3] EX2: 1st: [6, 5, 2,1] cutoff: 6 after call: 1st: returned list: [6, 5, 2, 11 REQUIREMENTS: RUNTIME: THETA (n) where n is the length of the given list ORDERING the ordering of the returned list should be the same as in the given list MEMORY: for full credit, no new nodes should be allocated or deallocated; you should just "re-use" the existing nodes. HOWEVER, you will need to allocate a LIST structure itself (i.e., for the returned list) List filter leq (const T &cutoff) return nullptr

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!