Tutorialspoint.dev
Welcome To Tutorialspoint.dev
Officially launched 18th May 2019
Strings String Duplicates Strings

Print all the duplicates in the input string

Write an efficient C program to print all the duplicates and their counts in the input string Algorithm: Let input string be “geeksforgeeks” 1: Constr...
Arrays Amazon Paytm

Find duplicates in O(n) time and O(1) extra space Set 1

Given an array of n elements which contains elements from 0 to n-1, with any of these numbers appearing any number of times. Find these repeating numbers in O(n) and...
Arrays Bit Magic Arrays

Find Duplicates of array using bit array

You have an array of N numbers, where N is at most 32,000. The array may have duplicates entries and you do not know what N is. With only 4 Kilobytes of memory avail...
Greedy Strings Strings

Print a closest string that does not contain adjacent duplicates

Given a string S, change the smallest number of letters in S such that all adjacent characters are different. Print the resultant string. Examples : Input : S = &quot...
Binary Search Tree Self-Balancing-BST Binary Search Tree

How to handle duplicates in Binary Search Tree?

In a Binary Search Tree (BST), all keys in left subtree of a key must be smaller and all keys in right subtree must be greater. So a Binary Search Tree by definition...
Arrays Hash Arrays

Find duplicates in a given array when elements are not limited to a range

Given an array of n integers. The task is to print the duplicates in the given array. If there are no duplicates then print -1. Examples: Input : {2, 10, 100, 2, 10,...
Arrays Hash Sorting

Check if array contains contiguous integers with duplicates allowed

Given an array of n integers(duplicates allowed). Print “Yes” if it is a set of contiguous integers else print “No”. Examples: Input : arr...
Linked List Merge Sort Linked List

Remove duplicates from an unsorted linked list

Write a removeDuplicates() function which takes a list and deletes any duplicate nodes from the list. The list is not sorted. For example if the linked list is 12-&g...
Linked List Adobe Myntra

Remove duplicates from a sorted linked list

Write a function which takes a list sorted in non-decreasing order and deletes any duplicate nodes from the list. The list should only be traversed once. For example...
Linked List doubly linked list Linked List

Remove duplicates from an unsorted doubly linked list

Given an unsorted doubly linked list containing n nodes. The problem is to remove duplicate nodes from the given list. Examples: Recommended: Please try your appro...

Subscribe to Our Newsletter