A given word w is called “prime” if it cannot be written in the form of the concatenation of several copies of some shorter word. So, for example the words ‘100′, ‘1100′, and ‘001100′ are prime, while the words ‘0101′,... (Continue reading)
A positive integer is called a palindrome if its representation in the decimal system is the same when read from left to right and from right to left. For a given positive integer K of not more than 1000000 digits,... (Continue reading)
How do i perform UNION operation on two sets S1 and S2 such that the opearation takes O(1) time using a list data structure? Answer1: this algorithm will take O(n) time 1)we will parse two lists completely , at the time time of... (Continue reading)