algos.tnsatish.com
Interview questions on Algorithms, Programming: Princess, Flowers and Snake With Incorrect Name Plates
http://algos.tnsatish.com/2011/04/princess-flowers-and-snake-with.html
Interview questions on Algorithms, Programming. Wednesday, April 27, 2011. Princess, Flowers and Snake With Incorrect Name Plates. Go to the room which has the nameplate Snake. That will not have Snake. If the room has princess, you are done. If the room has flowers, then go to the room which has nameplate flowers. Princess would be there in that room. [Since, Princess cannot be there in the room which has nameplate Princess.]. April 13, 2014 at 12:24 AM. May 15, 2014 at 4:41 PM. View my complete profile.
algos.tnsatish.com
Interview questions on Algorithms, Programming: Efficiently Right Shift a String
http://algos.tnsatish.com/2014/04/efficiently-right-shift-string.html
Interview questions on Algorithms, Programming. Sunday, April 13, 2014. Efficiently Right Shift a String. You are given a string and a number k. You need to right shift the string k times. What is the efficient way to solve this? The string is "Democracy". If k is 2, then the output should be "cyDemocra". If k is 3, then the output should be "acyDemocr". O(nk) time complexity, O(1) space complexity. Where n is the length of the string. Right shift the string k times. Reverse the entire array. Cold Bloode...
algos.tnsatish.com
Interview questions on Algorithms, Programming: No.of Nodes in a Tree
http://algos.tnsatish.com/2014/04/noof-nodes-in-tree.html
Interview questions on Algorithms, Programming. Wednesday, April 23, 2014. Noof Nodes in a Tree. Int Count(Node root) { if(root = NULL) return 0; return 1 Count(root- left) Count(root- right); }. Subscribe to: Post Comments (Atom). Cold Blooded Economist, Hyprocite, Lazy, Pessimistic, Capitalist, Aspiring to be a Devotee of Krishna; Servant of Desire, Anger, Greed, Delusion, Pride and Jealousy. View my complete profile. Enter your email address:. Petrol Bunks in Circle. No Child After a Girl Child.
algos.tnsatish.com
Interview questions on Algorithms, Programming: No Child After a Girl Child
http://algos.tnsatish.com/2014/04/no-child-after-girl-child.html
Interview questions on Algorithms, Programming. Saturday, April 26, 2014. No Child After a Girl Child. Government introduced a rule saying, once a couple gets a girl child, they should not have any more children. What would be the ratio of boys to girls after n years? It would be 1:1 only [If we assume, for any birth the ratio of boy to girl is 1:1]. Let's suppose, if there 1000 couples. If we take 1:1 in the births, then 500 would give birth to boys and 500 would give birth to girls. Noof Nodes in a Tree.
algos.tnsatish.com
Interview questions on Algorithms, Programming: Find Colored Couples
http://algos.tnsatish.com/2014/04/find-colored-couples.html
Interview questions on Algorithms, Programming. Monday, April 21, 2014. In an array of colors, we need to find out the no.of colored couples of the same color that are next to each other. If you find a colored couple, then you can remove that couple, and check whether any more couples can be formed by that or not. In the above, there are two B's next to each other. That is one couple, and we can remove that. After removing both the B's, the colors would be like. After removing R, it would be like below.
algos.tnsatish.com
Interview questions on Algorithms, Programming: Find whether two strings are anagrams of each other or not
http://algos.tnsatish.com/2014/04/find-whether-two-strings-are-anagrams.html
Interview questions on Algorithms, Programming. Monday, April 14, 2014. Find whether two strings are anagrams of each other or not. Given a two strings, find whether they are anagrams of each other or not. Anagram means, rearranging of the characters in the string. Mary and army are anagrams. Abba and abab are anagrams. Abba and abbb are not anagrams. Assumption: The characters are ASCII characters. AreAnagrams(char a[], char b[]) { int count[128]; int n=strlen(a); if(n! 0) return false; return true; }.
algos.tnsatish.com
Interview questions on Algorithms, Programming: Constructing Tree From Inorder and Preorder
http://algos.tnsatish.com/2011/09/constructing-tree-from-inorder-and.html
Interview questions on Algorithms, Programming. Wednesday, September 28, 2011. Constructing Tree From Inorder and Preorder. ConstructTree(preorder, 0, preOrder.Length-1, inorder, 0, inorder.Length-1);. Node ConstructTree(int[] preorder, int ps, int pe, int[] inorder, int is, int ie) { if(ps. Data = preorder[ps]; int mid = is; while(inorder[mid]! Subscribe to: Post Comments (Atom). View my complete profile. Enter your email address:. Constructing Tree From Inorder and Preorder.
algos.tnsatish.com
Interview questions on Algorithms, Programming: Four People crossing the river with different speeds
http://algos.tnsatish.com/2011/04/four-people-crossing-river-with.html
Interview questions on Algorithms, Programming. Wednesday, April 27, 2011. Four People crossing the river with different speeds. 1 and 2 cross the tunnel. 5 and 10 cross the tunnel. 1 and 2 cross the tunnel. Total Time: 17 hours. Subscribe to: Post Comments (Atom). Cold Blooded Economist, Hyprocite, Lazy, Pessimistic, Capitalist, Aspiring to be a Devotee of Krishna; Servant of Desire, Anger, Greed, Delusion, Pride and Jealousy. View my complete profile. Enter your email address:.
algos.tnsatish.com
Interview questions on Algorithms, Programming: In a Binary Tree, find sum of all the nodes below certain level
http://algos.tnsatish.com/2014/04/in-binary-tree-find-sum-of-all-nodes_17.html
Interview questions on Algorithms, Programming. Thursday, April 17, 2014. In a Binary Tree, find sum of all the nodes below certain level. Given a binary tree, find sum of all the nodes below certain level. Root is at level 0. All the children of root are at level 1. All the grand children of root are at level 2. Given a level n, find some of all the nodes that are at level n or more. Subscribe to: Post Comments (Atom). View my complete profile. Enter your email address:. Petrol Bunks in Circle.
algos.tnsatish.com
Interview questions on Algorithms, Programming: Delete all the nodes in a Tree in C
http://algos.tnsatish.com/2014/04/delete-all-nodes-in-tree-in-c.html
Interview questions on Algorithms, Programming. Tuesday, April 22, 2014. Delete all the nodes in a Tree in C. Void Clear(Node root) { if(root = NULL) return; Clear(root- left); Clear(root- right); free(root); }. Subscribe to: Post Comments (Atom). Cold Blooded Economist, Hyprocite, Lazy, Pessimistic, Capitalist, Aspiring to be a Devotee of Krishna; Servant of Desire, Anger, Greed, Delusion, Pride and Jealousy. View my complete profile. Enter your email address:. Petrol Bunks in Circle.
SOCIAL ENGAGEMENT