Print the nodes of linked list at given indexes
Given a collection of sorted index, Our goal is to find and print all nodes on linked list which is exist on given index. For example.
Example 1
Input List : 4 → 8 → 7 → 3 → 8 → 6 → 10 → 19 → -5 → NULL
Index List : 2 → 4 → 7 → NULL
Output : 8 3 10 [value at index]
Example 2
Input List : 4 → 8 → 7 → 3 → 8 → 6 → 10 → 19 → -5 → NULL
Index List : 3 → 5 → 6 → 8 → NULL
Output : 7 8 6 19
This problem are based on traversal of linked list.
-
1) Print the linked list node by given list of indexes in java
2) Print the linked list node by given list of indexes in c++
3) Print the linked list node by given list of indexes in c
4) Print the linked list node by given list of indexes in php
5) Print the linked list node by given list of indexes in c#
6) Print the linked list node by given list of indexes in python
7) Print the linked list node by given list of indexes in ruby
8) Print the linked list node by given list of indexes in scala
9) Print the linked list node by given list of indexes in swift
10) Print the linked list node by given list of indexes in kotlin
11) Print the linked list node by given list of indexes in golang
12) Print the linked list node by given list of indexes in vb.net
13) Print the linked list node by given list of indexes in node js
14) Print the linked list node by given list of indexes in typescript
Please share your knowledge to improve code and content standard. Also submit your doubts, and test case. We improve by your feedback. We will try to resolve your query as soon as possible.
New Comment