The most fundamental characteristic of any programming language is the data types it supports..Basically data types refers to the types of values which can be represented and manipulated in that programming language.
array_reverse() is an inbuilt function of PHP used to reverse the array including the nested arrays. It returns the reversed array. But in the case of associative arrays of if you don't want to change the keys of the array, $key_preserve=true can be passed as a parameter to the array_reverse() function.
We will discuss an easy approach to generate all the rotations of a string. Approach is simple we will concatenate the given string with itself and then we will be able to generate all the rotations. C++ Program to generate all the rotations of a given string is given below along with its algorithm.
In this program an array is given to you and you have to find the peak elements in the array.. A peak element in the array is the element which is greater than its left and right elements. Therefore, There can be multiple peak elements in the array.
C++ Program to reverse the vowels of a string is given below. Approach is simple, we will use two pointer approach. First we will initialize a counter at the start of the string and the other one is at the end of the string. Time complexity of the program given below is O(n) and space complexity is O(1).