Find Relative Complement of two Sorted ArraysWe will learn how to find the relative complement of two sorted arrays in this lesson. A sorted array is one that has been organised in a specified order (alphabetic, chronological, ordinal, cardinal order). An unsorted array is one that is not ordered in any way. Let us assume two sorted arrays: array1 and array2 of size p and q, respectively. We have to determine the relative complement of two arrays, array1 - array2, that indicates we have to locate all the elements in array1 but not in array2. Examples:
Implementation: C++ Program: Output: 6 12 15
|
JavaTpoint offers too many high quality services. Mail us on h[email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].
Duration: 1 week to 2 week