Practice 30 C Programming Questions on Hash, TechnoVlogs

Practice 30 C Programming Questions on Hash


Q1. Write a program in C to create a basic hash table with integer keys.

Q2. Write a program to insert keys into a hash table with chaining to handle collisions.

Q3. Write a program in C to search for a key in the hash table using chaining.

Q4. Write a program in C to delete a key from the hash table using chaining.

Q5. Write a program in C to count the frequency of each unique element in an array using a hash table.

Q6. Write a program in C to find duplicate elements in an array using a hash table.

Q7. Write a program in C to implement a hash table with linear probing to resolve collisions.

Q8. Write a program in C to implement a hash table with quadratic probing for collision resolution.

Q9. Write a program to implement rehashing in a hash table when the load factor exceeds a threshold.

Q10. Write a program in C to count the frequency of words in a given string using a hash table.

Q11. Write a program in C to check if two strings are anagrams of each other using a hash table.

Q12. Write a program in C to find the first non-repeating character in a string using a hash table.

Q13. Write a program in C to find all pairs of elements in an array whose sum is equal to a given value using a hash table.

Q14. Write a program in C to reverse the elements of a hash table.

Q15. Write a program in C to sort the elements of a hash table.

Q16. Write a program in C to find the intersection of two arrays using a hash table.

Q17. Write a program in C to count the number of distinct elements in an array using a hash table.

Q18. Write a program in C to check if there exists a subarray with a sum of zero using a hash table.

Q19. Write a program in C to find the majority element in an array using a hash table.

Q20. Write a program in C to find if there is a pair of elements with a given difference in an array using a 

Q21. Write a program in C to find all duplicates in an array using a hash table.

Q22. Write a program in C to find all elements in an array that appear more than n/k times using a hash table.

Q23. Write a program in C to find the count of subarrays with a given sum using a hash table.

Q24. Write a program in C to find the largest subarray with an equal number of 0s and 1s using a hash table.

Q25. Write a program in C to find the length of the longest consecutive elements sequence using a hash table.

Q26. Write a program in C to find the first non-repeating character in a string using a hash table.

Q27. Write a program in C to check if two strings are anagrams using a hash table.

Q28. Write a program in C to count the frequencies of each element in an array using a hash table.

Q29. Write a program in C to find the kth most frequent element in an array using a hash table.

Q30. Write a program in C to find the length of the longest subarray that contains at most k distinct elements using a hash table.

Social Share

Bikki Singh Instructor TechnoVlogs

Bikki Singh

Hi, I am the instructor of TechnoVlogs. I have a strong love for programming and enjoy teaching through practical examples. I made this site to help people improve their coding skills by solving real-world problems. With years of experience, my goal is to make learning programming easy and fun for everyone. Let's learn and grow together!