## Print sorted unique elements of a given array

Objective: Given an array of integers with duplicates, write a program to print unique elements in the array in sorted order. Example: Given Input: [6, 1, 8, 5, 2, 10, 17, 25, 6, 5,...

@tutorialhorizon

Objective: Given an array of integers with duplicates, write a program to print unique elements in the array in sorted order. Example: Given Input: [6, 1, 8, 5, 2, 10, 17, 25, 6, 5,...

Objective: Given a list of intervals with start and end for each interval. You have given a value V, write an algorithm to find the number of intervals in which the value V lies. ...

Objective: Given two sets of integers, write an algorithm to print the sum of overlapping elements in two sets. Note: Elements in each set are unique or there are no duplicates within a set....

Objective: Given two coordinates (x1, y1) and (x2, y2). Write a java program to construct a line equation that passes through the given coordinates. Line Equation: Given two coordinates (x1, y1) and (x2, y2)...

Objective: Given a two-dimensional array, write a program to print all middle elements of the array. Or In other words, print all the elements from the array except boundary elements. Example: int [][] grid...

Objective: Given a two-dimensional array or matrix, Do the depth-First Search (DFS) to print the elements of the given matrix. Implement the Depth-first traversal in a recursive manner. Example: int [][] grid = new...

Objective: Given two integers, write an algorithm to calculate the hamming distance between the integers. Hamming Distance: Hamming distance between two integers is the number of positions at which the bits are different. Example:...

Objective: Given a two-dimensional array or matrix, Do the breadth-First Search (BFS) to print the elements of the given matrix. Implement a Breadth-first traversal in an iterative manner. Example: int [][] grid = new...

Objective: Given a range of integers, wrote a program to find all the Armstrong numbers in that range. What is Armstrong number: Determine the number of digits in the number. Call that n. Then...

Objective: Given a binary tree, write an algorithm to check if the tree is Full or not. Full binary tree: A binary tree T is full if each node is either a leaf or...

Objective: Given an undirected graph, write an algorithm to find out whether the graph is connected or not. Graph Connectivity: If each vertex of a graph is connected to one or multiple vertices then...

Objective: Given a two-dimensional array, write a program to print the boundary of the array. Example: int [][] grid = new int[][] { {1, 2, 3, 4}, {5, 6, 7, 8}, {9, 8, 7,...

Objective: Given a two-dimensional array or matrix, Do the depth-First Search (DFS) to print the elements of the given matrix. Implement the Depth-first traversal in an iterative manner. Example: int [][] grid = new...

Objective: Given a stack, write a program to print the stack elements in reverse order. Example: Approach: Use Temporary stack: Take temporary stack, and copy all the items from the given stack to a...

Objective: Given an array of numbers, write an algorithm to print all the subsets sum individually. Example: Given Input: [1, 2] Output: 3 1 2 0 Explanation: subsets are [0], [1], [2], [1, 2]...

%d bloggers like this: