Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
3 views

C_Array_Programming_100_Questions

The document lists 104 array-related programming questions and tasks in C, covering a wide range of topics including array manipulation, searching, sorting, and matrix operations. Each question is designed to test and enhance skills in handling arrays and implementing algorithms. The tasks vary in complexity, making it suitable for learners at different levels of proficiency in C programming.

Uploaded by

Prashanth Vpc
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

C_Array_Programming_100_Questions

The document lists 104 array-related programming questions and tasks in C, covering a wide range of topics including array manipulation, searching, sorting, and matrix operations. Each question is designed to test and enhance skills in handling arrays and implementing algorithms. The tasks vary in complexity, making it suitable for learners at different levels of proficiency in C programming.

Uploaded by

Prashanth Vpc
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

C Programming - 100 Array Questions

1. Declare and initialize an integer array.

2. Find the sum of all elements in an array.

3. Find the maximum element in an array.

4. Find the minimum element in an array.

5. Search for an element in an array (linear search).

6. Search for an element in a sorted array (binary search).

7. Insert an element at a specific position in an array.

8. Delete an element from an array.

9. Reverse an array.

10. Sort an array using bubble sort.

11. Sort an array using selection sort.

12. Sort an array using insertion sort.

13. Sort an array using quick sort.

14. Sort an array using merge sort.

15. Merge two sorted arrays into one.

16. Find the second largest element in an array.

17. Find the second smallest element in an array.

18. Count the frequency of each element in an array.

19. Find duplicate elements in an array.

20. Remove duplicate elements from an array.

21. Rotate an array to the right by k steps.

22. Rotate an array to the left by k steps.

23. Find the common elements between two arrays.

24. Find the union of two arrays.

25. Find the intersection of two arrays.


26. Find the difference of two arrays.

27. Copy one array to another.

28. Check if two arrays are equal.

29. Find the k-th largest element in an array.

30. Find the k-th smallest element in an array.

31. Move all zeros to the end of the array.

32. Segregate even and odd numbers in an array.

33. Find the subarray with the maximum sum (Kadane's Algorithm).

34. Implement dynamic array using malloc.

35. Check if an array is a palindrome.

36. Count positive, negative, and zero elements.

37. Calculate the average of array elements.

38. Find the majority element (appears more than n/2 times).

39. Find missing number in a consecutive array of numbers.

40. Find the element that appears only once when all others appear twice.

41. Implement 2D array and perform matrix addition.

42. Perform matrix subtraction using 2D arrays.

43. Perform matrix multiplication using 2D arrays.

44. Transpose a 2D array (matrix).

45. Check if a matrix is symmetric.

46. Check if a matrix is identity matrix.

47. Find the diagonal elements of a matrix.

48. Sum of diagonal elements of a matrix.

49. Find the row with maximum number of 1s in a binary matrix.

50. Calculate the sum of each row and column of a matrix.

51. Find the upper triangular matrix.

52. Find the lower triangular matrix.


53. Sort each row of a matrix.

54. Sort each column of a matrix.

55. Print boundary elements of a matrix.

56. Find the saddle point in a matrix.

57. Print matrix in spiral order.

58. Print matrix in zigzag order.

59. Create a 3D array and access its elements.

60. Sum of all elements in a 3D array.

61. Flatten a 2D array into 1D array.

62. Reshape a 1D array into 2D array.

63. Perform element-wise addition of two arrays.

64. Perform element-wise multiplication of two arrays.

65. Find the longest increasing subarray.

66. Find the longest contiguous subarray with all distinct elements.

67. Find the maximum product subarray.

68. Rearrange array in alternating positive and negative items.

69. Find leaders in an array.

70. Replace each element with the next greatest element.

71. Check if an array contains duplicate elements.

72. Find the first repeating element.

73. Find the first non-repeating element.

74. Count pairs with given sum.

75. Find all unique triplets with sum zero.

76. Print all subarrays of an array.

77. Find the minimum length subarray with given sum.

78. Find maximum circular subarray sum.

79. Check if array is sorted.


80. Find minimum and maximum in array with minimum comparisons.

81. Print array in reverse order using recursion.

82. Check if two arrays are permutations of each other.

83. Count number of elements smaller than each element.

84. Find closest pair from two sorted arrays.

85. Find equilibrium index in array.

86. Replace elements with ranks.

87. Partition array into two subsets with equal sum.

88. Find peak element.

89. Check if array can be divided into three parts with equal sum.

90. Find all elements that appear more than n/3 times.

91. Remove all occurrences of a given element.

92. Find common elements in three sorted arrays.

93. Sort binary array (0s and 1s).

94. Sort array of 0s, 1s and 2s (Dutch national flag).

95. Count number of occurrences of a given number.

96. Find duplicates in array using constant space.

97. Find the smallest missing positive number.

98. Find intersection of two unsorted arrays.

99. Find union of two unsorted arrays.

100. Find smallest and second smallest elements.

101. Calculate product of all elements except current (no division).

102. Rearrange array to maximize sum of i*arr[i].

103. Generate all subsets of an array.

104. Implement array rotation using reversal algorithm.

You might also like