You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DSA Crack Sheet/README.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -133,6 +133,7 @@
133
133
-[Move last element to front of a given Linked List](https://www.geeksforgeeks.org/move-last-element-to-front-of-a-given-linked-list/"view topic")
134
134
-[Add 1 to a number represented as linked list](https://practice.geeksforgeeks.org/problems/add-1-to-a-number-represented-as-linked-list/1#"view question") - [Cpp Solution](./solutions/Add%201%20to%20a%20number%20represented%20as%20linked%20list.cpp)
135
135
-[Add two numbers represented by linked lists](https://practice.geeksforgeeks.org/problems/add-two-numbers-represented-by-linked-lists/1#"view question") - [Cpp Solution](./solutions/Add%20two%20numbers%20represented%20by%20linked%20lists.cpp)
136
+
-[Intersection of two sorted Linked lists](https://practice.geeksforgeeks.org/problems/intersection-of-two-sorted-linked-lists/1#"view question") - [Cpp Solution](./solutions/Intersection%20of%20two%20sorted%20Linked%20lists.cpp)
Given two lists sorted in increasing order, create a new list representing the intersection of the two lists. The new list should be made with its own memory — the original lists should not be changed.
6
+
7
+
Example 1:
8
+
Input:
9
+
L1 = 1->2->3->4->6
10
+
L2 = 2->4->6->8
11
+
Output: 2 4 6
12
+
Explanation: For the given first two
13
+
linked list, 2, 4 and 6 are the elements
14
+
in the intersection.
15
+
16
+
Example 2:
17
+
Input:
18
+
L1 = 10->20->40->50
19
+
L2 = 15->40
20
+
Output: 40
21
+
Your Task:
22
+
The task is to complete the function intersection() which should find the intersection of two linked list and add all the elements in intersection to the third linked list and return the head of the third linked list.
0 commit comments