
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 26504 Articles for Server Side Programming

566 Views
The data collected for the first time is utilised as it is but when we need to go for secondary data to conduct the same or similar study again, we can use new data as well as the primary data. In this type of situations, we might want to randomly organize data rows that includes new and old data. Also, there is a possibility of missing data row which is found at later stage in the study then it can be also added. Hence, a row might be required to added in the existing data frame. This can be done ... Read More

301 Views
Suppose we have the preorder traversal of a binary search tree (BST). We have to check whether each internal node has only one child or not.So, if the input is like preorder = [22, 12, 13, 15, 14], then the output will be True as BST is like −To solve this, we can follow one efficient approach. As all decedents of a node is either smaller or larger, then we can we can follow these steps −Get the next preorder successor of the nodeGet the last preorder successor of the nodeNow when both the successors are less than or greater ... Read More

270 Views
Suppose we have two numbers x and y. We have to check whether difference of their areas is prime or not.So, if the input is like x = 7, y = 6, then the output will be True as the difference of their square is 49 - 36 = 13 which is prime.To solve this, we will follow these steps −if (x + y) is prime number and (x - y) is 1, thenreturn Trueotherwise,return FalseLet us see the following implementation to get better understanding −Example Live Demodef is_prime(num) : if num

199 Views
Suppose we have one octal number. We have to check whether the decimal representation of the given octal number is divisible by 7 or not.So, if the input is like n = 61, then the output will be True as the decimal representation of 61 is 6*8 + 1 = 48 + 1 = 49 which is divisible by 7.So, if the input is like n = 61, then the output will be True as the decimal representation of 61 is 6*8 + 1 = 48 + 1 = 49 which is divisible by 7.To solve this, we will follow ... Read More

835 Views
Suppose we have a number n, we have to find its total number of divisors are even or odd.So, if the input is like n = 75, then the output will be Even, as the divisors are [1, 3, 5, 15, 25, 75].To solve this we shall follow one simple and efficient approach. We have observed that when a number is perfect square then only it has odd number of divisors. So if the number is not perfect square then it will have even divisors. So here we will only check whether the number is perfect square or not and ... Read More

368 Views
Suppose we have two bracket sequences s and t with only these characters '(' and ')'. We have to check whether the concatenated string of s and t is balanced or not. The concatenation can be done by s | t or t | s.So, if the input is like s = "()()))", t = "()(()(", then the output will be True because if we concatenate t | s, then we will get "()(()(()()))", which is balanced.To solve this, we will follow these steps −Define a function is_balanced_parenthesis() . This will take stringstack := a new listfor i in range ... Read More

180 Views
Suppose we have two strings s and t, we have to check whether we can generate t by swapping the character of the s.So, if the input is like s = "worldlloeh" t = "helloworld", then the output will be True as we can swap characters from "worldlloeh" to make "helloworld".To solve this, we will follow these steps −s_len := size of s, t_len := size of tif s_len is not same as t_len, thenreturn Falsefreq := a map to store all characters and their frequencies in sfor i in range 0 to t_len, dofreq[t[i]] := freq[t[i]] - 1if freq[t[i]] ... Read More

1K+ Views
Suppose we have a string s, we have to check whether characters of the given string can be shuffled to make a palindrome or not.So, if the input is like s = "raaecrc", then the output will be True as we can rearrange this to "racecar" which is a palindrome.To solve this, we will follow these steps −freq := a map to store all characters and their frequencies in sodd_count := 0for each element i in the list of all values of freq, doif i is odd, thenodd_count := odd_count + 1if odd_count > 1, thenreturn Falsereturn TrueLet us see ... Read More

188 Views
Suppose we have a lowercase string; we have to check whether we can split the string from middle which will give two halves having at least one-character difference between two sides. It may hold different characters or different frequency of each character. If the string is odd length string, then ignore the middle element and check for the remaining elements.So, if the input is like s = "helloohekk", then the output will be True as "helloohekk" so left part is "hello" right part is "ohekk" left and right are different.To solve this, we will follow these steps −left_freq := an ... Read More

385 Views
Suppose we have an array of numbers called nums. We have to check whether there exists any subset of the nums whose bitwise AND is a power of two or not.So, if the input is like nums = [22, 25, 9], then the output will be True, as a subset {22, 9} the binary form is {10110, 1001} the AND of these two is 10000 = 16 which is power of 2.To solve this, we will follow these steps −MAX := 32 considering there are 32 bits numbers at maxDefine a function solve() . This will take numsif size of ... Read More