Detail Form
We will send your result on your email id and phone no. please fill detail
Delete a singly linked list. Your task is to complete the method deleteList() which deletes linked list . The function returns 0
Input:
The first line of input contains an integer N denoting the number of elements of the linked list. Then in the next line are N space separated values of the linked list.
User Task:
The task is to complete the function deleteList() which should delete the node at required position.
Constraints:
1 <= T <= 300
2 <= N <= 100
1 <= x <= N
Example:
Input:
8
2 4 5 6 7 1 9 0
Given two integer arrays of same size, “arr[]” and “index[]”, reorder elements in “arr[]” according to given index array. It is not allowed to given array arr’s length.
Expected time complexity O(n) and auxiliary space O(1)
Given a singly linked list. The task is to find the length of the linked list, where length is defined as the number of nodes in the linked list.
Example 1:
Input: 8 2 4 5 6 7 1 9 0 Output: 8 Explanation: Count of nodes in the linked list is 8, which is its length.
Example 2:
Input: 5 3 4 5 7 3 Output: 5 Explanation: Count of nodes in the linked list is 5. Hence, the output is 5.
Your Task:
Your task is to complete the given function getCount(), which takes a head reference as an argument and should return the length of the linked list.
Expected Time Complexity : O(N)
Expected Auxilliary Space : O(1)
Constraints:
1 <= N <= 105
1 <= value <= 103
Given an array, rotate the array by one position in clock-wise direction.
Your Task:
You don't need to read input or print anything. Your task is to complete the function rotate() which takes the array A[] and its size N as inputs and modify the array.
Expected Time Complexity: O(N)
Expected Auxiliary Space: O(1)
Constraints:
1<=N<=105
0<=a[i]<=105