Computer Science, asked by akilsalman, 4 months ago

write an algorithm that return the number of positive values in a linear linked list
fast plz

Answers

Answered by laxmidaslaxminarayan
0

Answer

You are given an unsorted array with both positive and negative elements. You have to find the smallest positive number missing from the array in O(n) time using constant extra space. You can modify the original array.

Examples

Input: {2, 3, 7, 6, 8, -1, -10, 15}

Output: 1

Input: { 2, 3, -7, 6, 8, 1, -10, 15 }

Output: 4

Input: {1, 1, 0, -1, -2}

Output: 2

Similar questions