AGAstitva Goelindevitease.hashnode.dev·Jan 12, 2023 · 2 min readSearching Algorithms in ArraysWhen you need to find a particular value in an array you apply searching algorithms. There are two search algorithms for an Array:- Linear Search Binary Search Linear Search It is an algorithm for searching in an array by traversing the whole arr...00
AGAstitva Goelindevitease.hashnode.dev·Jan 12, 2023 · 4 min readQuestions on Arrays Part-5.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...00
AGAstitva Goelindevitease.hashnode.dev·Dec 28, 2022 · 3 min readQuestions on Arrays Part-4Q17. 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=...00
AGAstitva Goelindevitease.hashnode.dev·Dec 27, 2022 · 4 min readQuestions on Arrays Part-3Q12. Merge two sorted arrays without using any extra space. Assume one array to have two times space so that merging can be performed. A12. We will use two pointer approach to this question. One pointer for the first array and a second for the second...00
AGAstitva Goelindevitease.hashnode.dev·Dec 26, 2022 · 6 min readQuestions on Arrays Part-2Moving 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...00