Top 50 Data structure questions

Posted by admin at November 6, 2019

  1. Write a program to find the missing number in a given integer array of 1 to 100.
  2. Write a program to find the duplicate number on a given integer array.
  3. Write a program to find the largest and smallest number in an unsorted integer array.
  4. Write a program to find all pairs of an integer array whose sum is equal to a given number.
  5. Write a program to find duplicate numbers in an array if it contains multiple duplicates.
  6. How are duplicates removed from a given array in Java.
  7. How is an integer array sorted in place using the quick-sort algorithm.
  8. Write a program to remove duplicates from an array in place.
  9. Write a program to reverse an array in place in Java.
  10. How are duplicates removed from an array without using any library.
  11. Write a program to find the middle element of a singly linked list in one pass.
  12. Write a program to check if a given linked list contains a cycle.
  13. Write a program to find the starting node of the cycle.
  14. Write a program to reverse a linked list.
  15. Write a program to reverse a singly linked list without recursion.
  16. How are duplicate nodes removed in an unsorted linked list.
  17. Write a program to find the length of a singly linked list.
  18. Write a program to find the third node from the end in a singly linked list.
  19. Write a program to find the sum of two linked lists using Stack.
  20. Write a program to print duplicate characters from a string.
  21. Write a program to check if two strings are anagrams of each other.
  22. Write a program to print the first non-repeated character from a string.
  23. How can a given string be reversed using recursion.
  24. Write a program to check if a string contains only digits.
  25. How are duplicate characters found in a string.
  26. Write a program to count a number of vowels and consonants in a given string.
  27. Write a program to count the occurrence of a given character in a string.
  28. Write a program to find all permutations of a string.
  29. Write a program to reverse words in a given sentence without using any library method.
  30. Write a program to check if two strings are a rotation of each other.
  31. Write a program to check if a given string is a palindrome.
  32. How is a binary search tree implemented.
  33. Write a program to perform pre-order traversal in a given binary tree.
  34. Write a program to traverse a given binary tree in pre-order without recursion.
  35. Write a program to perform an in-order traversal in a given binary tree.
  36. Write a program to print all nodes of a given binary tree using in-order traversal without recursion.
  37. Write a program to implement a post-order traversal algorithm.
  38. Write a program to traverse a binary tree in post-order traversal without recursion.
  39. How are all leaves of a binary search tree printed.
  40. Write a program to count a number of leaf nodes in a given binary tree.
  41. Write a program to perform a binary search in a given array.
  42. How is a bubble sort algorithm implemented.
  43. How is an iterative quick-sort algorithm implemented.
  44. Write a program to implement an insertion sort algorithm.
  45. How is a merge sort algorithm implemented.
  46. Write a program to implement a bucket sort algorithm.
  47. Write a program to implement a counting sort algorithm.
  48. How is a radix sort algorithm implemented.
  49. Write a program to swap two numbers without using the third variable.
  50. Write a program to check if two rectangles overlap with each other.
  51. Write a program to design a vending machine.

Comments

Write a Reply or Comment

Your email address will not be published. Required fields are marked *