100+ C Programming Questions Based on Array

100+ C Programming Questions Based on Array
Posted on 27-08-2023

C language questions based on an array

Array Manipulation:

  1. Reverse an array.
  2. Find the maximum and minimum elements in an array.
  3. Calculate the sum and average of array elements.
  4. Find the frequency of elements in an array.
  5. Remove duplicates from an array.
  6. Find the second largest and second smallest element in an array.

Searching and Sorting: 7. Implement binary search on a sorted array.

  1. Implement linear search on an unsorted array.
  2. Sort an array using selection sort.
  3. Sort an array using bubble sort.
  4. Sort an array using insertion sort.
  5. Merge two sorted arrays.
  6. Implement quicksort algorithm.
  7. Count the number of inversions in an array.

Matrix Operations: 15. Add two matrices.

  1. Multiply two matrices.
  2. Find the transpose of a matrix.
  3. Check if a matrix is symmetric.
  4. Calculate the sum of diagonal elements in a matrix.

String Manipulation: 20. Store a list of strings in an array and sort them.

  1. Concatenate multiple strings in an array.
  2. Find the longest and shortest strings in an array of strings.

Stack and Queue Implementations: 23. Implement a stack using an array.

  1. Implement a queue using an array.
  2. Implement a circular queue.

Histograms and Data Analysis: 26. Create a histogram from an array of data.

  1. Calculate the mean, median, and mode of an array of numbers.
  2. Find outliers in a dataset using quartiles.

Palindromes and Anagrams: 29. Check if a string is a palindrome using an array.

  1. Check if two strings are anagrams using arrays.

Prime Numbers: 31. Generate prime numbers using the Sieve of Eratosthenes algorithm.

  1. Check if a number is prime using trial division and an array of prime numbers.

Dynamic Arrays: 33. Implement a dynamic array (similar to std::vector in C++).

  1. Create an array that can dynamically resize as elements are added.

Multi-dimensional Arrays: 35. Implement a 2D array for a tic-tac-toe game.

  1. Implement matrix multiplication using multi-dimensional arrays.
  2. Create a maze and solve it using a 2D array.

Game-related Programs: 38. Implement a simple hangman game using arrays.

  1. Create a game of battleship using a 2D array.

Number Patterns: 40. Print Pascal's triangle using a 2D array.

  1. Generate and print the Fibonacci sequence using an array.

Encryption and Decryption: 42. Implement a Caesar cipher encryption and decryption using arrays.

Data Compression: 43. Implement Run-Length Encoding (RLE) compression algorithm using arrays.

File Handling: 44. Read numbers from a file into an array and perform calculations.

  1. Write array elements to a file and read them back.

Histogram Equalization: 46. Implement histogram equalization for image processing using arrays.

Sparse Matrices: 47. Implement a sparse matrix using arrays and perform matrix operations.

Dynamic Programming: 48. Implement a solution to the coin change problem using an array.

Graph Algorithms: 49. Implement an adjacency matrix representation for a graph and perform BFS/DFS.

Matrix Exponentiation: 50. Compute the power of a matrix using array multiplication.

Subarray Problems: 51. Find the maximum subarray sum using Kadane's algorithm.

Stock Prices: 52. Calculate the maximum profit by buying and selling stocks using an array.

Sorting Algorithms Comparison: 53. Compare the efficiency of different sorting algorithms on random data.

Polynomial Manipulation: 54. Implement addition and multiplication of polynomials using arrays.

Matrix Operations II: 55. Calculate the determinant of a matrix using recursion and arrays.

Sparse Matrix Transpose: 56. Implement the transpose of a sparse matrix using arrays.

Interpolation: 57. Implement linear interpolation using arrays.

FFT Implementation: 58. Implement the Fast Fourier Transform algorithm using arrays.

Time Series Analysis: 59. Implement moving averages for time series data using arrays.

Sudoku Solver: 60. Implement a Sudoku solver using a 2D array and backtracking.

Matrix Chain Multiplication: 61. Solve the matrix chain multiplication problem using dynamic programming.

Graph Shortest Path: 62. Implement Dijkstra's algorithm using arrays for finding shortest paths.

Convex Hull: 63. Implement the Graham scan algorithm to find the convex hull of points.

Matrix Exponentiation II: 64. Find the nth Fibonacci number using matrix exponentiation.

Largest Rectangle in Histogram: 65. Solve the largest rectangle in histogram problem using stacks and arrays.

Longest Common Subsequence: 66. Implement finding the longest common subsequence using dynamic programming.

Longest Increasing Subsequence: 67. Find the longest increasing subsequence in an array using dynamic programming.

0/1 Knapsack Problem: 68. Solve the 0/1 knapsack problem using dynamic programming and arrays.

Segment Tree: 69. Implement a segment tree for range minimum queries using arrays.

Heap Implementation: 70. Implement a binary heap using an array.

Topological Sorting: 71. Implement topological sorting of a directed graph using arrays.

Breadth-First Search (BFS): 72. Perform BFS on a graph using arrays.

Depth-First Search (DFS): 73. Perform DFS on a graph using arrays.

Two Pointers Technique: 74. Implement the two pointers technique for finding pairs in a sorted array.

Inversion Count: 75. Count inversions in an array using the merge sort algorithm.

Josephus Problem: 76. Solve the Josephus problem using an array and simulation.

Combination Sum: 77. Find all combinations that sum up to a given target using backtracking and arrays.

Trapping Rainwater: 78. Solve the trapping rainwater problem using arrays.

Maximum Subarray Product: 79. Find the maximum product of a subarray using arrays.

Longest Palindromic Substring: 80. Find the longest palindromic substring using dynamic programming and arrays.

Majority Element: 81. Find the majority element in an array using the Boyer-Moore Voting Algorithm.

Minimum Window Substring: 82. Solve the minimum window substring problem using arrays and sliding window.

Maximum Profit with K Transactions: 83. Solve the maximum profit problem with at most K transactions using arrays.

Coin Change II: 84. Solve the coin change problem to count the number of ways to make change.

Jump Game: 85. Solve the jump game problem using arrays and dynamic programming.

Word Break Problem: 86. Solve the word break problem using dynamic programming and arrays.

Largest Divisible Subset: 87. Find the largest divisible subset of an array using dynamic programming.

Meeting Rooms Problem: 88. Solve the meeting rooms problem using arrays and sorting.

Largest Sum of Non-Adjacent Numbers: 89. Find the largest sum of non-adjacent numbers using dynamic programming.

Longest Consecutive Subsequence: 90. Find the longest consecutive subsequence in an array using arrays.

Median of Two Sorted Arrays: 91. Find the median of two sorted arrays using binary search and arrays.

Counting Sort: 92. Implement the counting sort algorithm using arrays.

Radix Sort: 93. Implement the radix sort algorithm using arrays.

Bucket Sort: 94. Implement the bucket sort algorithm using arrays.

Array Intersection: 95. Find the intersection of two arrays using hashing and arrays.

Find All Numbers Disappeared in an Array: 96. Find all numbers that disappeared in an array using arrays.

Rotate Array: 97. Rotate an array by a given number of steps using arrays.

Move Zeroes: 98. Move all zeroes to the end of an array while maintaining the order of other elements.

Single Number: 99. Find the single non-repeated number in an array using bitwise XOR.

Product of Array Except Self: 100. Calculate the product of an array except for the current element without using division.