Skip to main content

BEST OF 36- ARRAY

DATA STRUCTURE-ARRAYS

In this blog, we will discuss the best 36 questions of the array. 

Firstly we need to know, What is an array?  Let's go into it and know about it.


An array is a homogeneous collection of elements and stored sequentially in memory. An array is a data structure that holds a similar type of element.


QUESTIONS

Q1. Reverse the array.

Q2. Find the maximum and minimum elements in an array.

Q3. Find the "Kth" max and min element of an array.

Q4. Write a program to cyclically rotate an array by one.

Q5. Find the union and intersection of two sorted arrays.

Q6. Move all the negatives elements to one side of the array.

Q7. find Largest sum contiguous Subarray.

Q8. Minimize the maximum difference between heights.

Q9. Minimum no. of Jumps to reach the end of an array.

Q10. find duplicate in an array of N+1 Integers

Q11. Merge Intervals

Q12. Next Permutation

Q13. Count Inversion

Q14. Merge 2 sorted arrays without using Extra space.

Q15. Kadane's Algo.

Q16. Best time to buy and sell stock

Q17. Find all pairs on integer array whose sum is equal to the given number

Q18. Find common elements In 3 sorted arrays

Q19. Rearrange the array in alternating positive and negative items with O(1) extra space

Q20. Find if there is any subarray with sum equal to 0

Q21. Find factorial of a large number

Q22. Find maximum product subarray 

Q23. Find longest consecutive subsequence.

Q24.Given an array of size n and a number k, find all elements that appear more than " n/k " times.

Q25. Find whether an array is a subset of another array

Q26. Maximum profit by buying and selling a share at most twice.

Q27. Find the triplet that sums to a given value.

Q28. Trapping Rainwater problem

Q29. Chocolate Distribution problem

Q30. Smallest Subarray with sum greater than a given value

Q31. Three-way partitioning of an array around a given value

Q32. Minimum swaps required to bring elements less equal K together

Q33. Minimum no. of operations required to make an array palindrome

Q34. Median of 2 sorted arrays of equal size

Q35. Median of 2 sorted arrays of different sizes.

Q36. 2SUM,3SUM,4SUM


Thank You!

Keep Learning!


Share with your mates.


Follow us for more amazing content.









Popular posts from this blog

CRACK INTERVIEW OF STATISTICIAN

CRACKING THE INTERVIEW OF DATA SCIENTIST AND STATISTICIAN IS NOT A PIECE OF CAKE. TO BECOME A DATA SCIENTIST IT IS NECESSARY TO UNDERSTAND THE STATISTICS CONCEPT. We all know that Statistics is the base of Machine Learning and is also one of the favorite topics for the research field and for mathematicians. For any Machine Learning and Data Science Interviews,  Statistics plays a big role to show your understandings of ML Algorithms.  So, We have prepared the list of Most Commonly Asked Interview Questions of Statistics. We've broken the statistics interview questions into three parts. BASIC MEDIUM ADVANCE BASICS(1)-STATS INTERVIEW QUESTIONS    Q1.What is Data?  Q2.What is Big Data?   Q3.What is Data analysis?   Q4. What is the Line?   Q5. What is a plane, hyperplane?   Q6.What is Stats?   Q7.What is quantitative data and qualitative data?   Q8.What are the types of stats?   Q9.What is the descriptive stats?   Q10.What i...

Computer Vision-OpenCV

  OpenCV-PYTHON MAGICAL LIBRARY This open-source library plays a very important role in computer vision, machine learning, and image processing. It supports multiple programming languages like Python, C++, Java, etc. It is used to detect and identify objects, faces, or even handwriting.                                         APPLICATIONS Vision-guided robotics surgery Follow eye movements Detect motion of the human Detect and recognize faces Track camera movements Autonomous Vehicle READ AND SHOW THE IMAGE In this section, we are going to discuss our first OpenCV example. We will see how to read and display the image. READ THE IMAGE 1 2 import cv2 as cv img = cv . imread( "path of image" ) imread=This method returns an image that is loaded from the specified file. DISPLAY THE IMAGE 1 cv . imshow( 'name' ,img) imshow= This method displays an image . READ AND SHOW THE...