Skip to content

sserpilozdemir/algorithm-java-II

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Question

Given a singly linked list and an integer, x, remove nodes greater than x.

Example

List = 95 → 121 → 29

x= 96 List becomes 95 → 29

Return a reference to the root node of the list after removing 121.

Function Description

Complete the function removeNodes in the editor below.

The function must return a reference to the root node of the final list.

removeNodes has the following parameter(s):

node listHead: a reference to the root hode of the singly-linked list

int x: integer, the maximum value to be included in the returned singly-linked list

Returns:

node: a reference to the root node of the final list console ```

Constraints
• 1 5n, x < 121
• 1 5 SinglyLinkedListNode values < 121

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages