Tagged: data structure

Find Smallest and Largest Element in an Array

“Find Smallest and Largest Element in an Array” is an elementary problem of an Array data structure for beginners. Here, we are given an array of size ‘n’ and our task is to find the largest and smallest element of the array. Example (Find smallest and Largest Element in an...

Count Even and Odd numbers in an Array

“Count Even and Odd numbers in an Array” is an elementary problem of array data structure for beginners. Here, we are given an array of size ‘n’ and our task is to count the number of even elements and number of odd elements of an array. Example: INPUT: Enter the...

blank

Reverse an Array

“Reverse an Array” is an elementary problem for beginners based on array data structure. Here, we are given an array containing ‘n’ elements and our task is to reverse given array. Example: INPUT ARRAY: Array[5] = {1, 2, 3, 4, 5} OUTPUT ARRAY: Array[5] = {5, 4, 3, 2, 1}...

blank

Find First Non-Repeating Character of the String

“Find First Non-Repeating Character of the String” is a very important and popular problem asked in many technical interviews of product-based companies.  Here, we are given a string of length ‘n’ and our task is to find the first non-repeating character of the string. Example: Input: COMPUTERSCIENCE Output: The first...

blank

Check Pangram String

“Check Pangram String” is a very popular and basic problem of string data structure, asked in many technical interviews. Here, we are given a string of length ‘n’ and our task is to check whether given string is panagram string or not. Panagram String: A string is called Panagram String...

blank

Check Whether String is Palindromic Anagram or Not

“Check Whether String is Palindromic Anagram or Not” is popular interview problem asked in many technical and algorithmic interviews. Here, we are given a string and our task is to write a program to check whether string is Palindromic Anagram or not.  A palindrome Anagram string is a string which can be...

blank

Check if Two Strings are Rotations of each other

“check if two strings are rotations of each other” is a popular interview problem based on string data structure. Here, we are given two strings str1 and str2 and our task is to check whether these two strings are in rotation of each other or not. Example: INPUT: String 1:...