Searching Algorithms in Arrays
Linear and Binary Search

Search for a command to run...
Articles tagged with #dsa
Linear and Binary Search

Q21. Check if the given array is a subset of another array. A21. To check this we transfer the elements of the array to a set, hence removing duplicates. And now we compare the set elements with the second array to check if it contains those elements...

Q17. Given 3 arrays sorted in increasing order. Find the common elements in all 3 arrays. A17. In this question, we will use a 3 pointer approach. public class CommonElements { static void common(int[] A, int[] B, int[] C){ int a=0,b=0,c=...

Moving on to some more interview questions from Arrays: Q6. Find the Union and Intersection of two arrays. A6. There are two approaches to this question. One is the two-pointer approach and the other is using a Set. Here we will go with the two-point...

Introduction In simple terms, Data Structures are ways to arrange data in the computer memory so that it can be used efficiently. Whereas, Algorithms can be defined as a sequence of steps performed on data or data structures to efficiently solve a pr...
