## Can we do a Binary search on a linked list ?

Of-course we can do a binary search on the linked list, But We have to think, Is is efficient. Binary Search is fast and effiecient in to array beacuse of […]

2,930 total views, 10 views today

Of-course we can do a binary search on the linked list, But We have to think, Is is efficient. Binary Search is fast and effiecient in to array beacuse of […]

2,930 total views, 10 views today

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
#include <iostream> #include <stdio.h> int oddoccurence(int arr[], int sizeArray); int main() { int n; int arr[10]; printf("Number of Element in to array\n"); scanf("%d",&n); printf("Enter the Element\n"); for(int i=0;i<n;i++) { scanf("%d",&arr[i]); } int oddelement=oddoccurence(arr,n); printf("odd Number of time element is= %d\n",oddelement); } int oddoccurence(int *arr, int n) { int res=0; for(int i=0;i<n;i++) { res=res^arr[i]; } return res; } |

1,826 total views, no views today

1,826 total views, no views today