Tag Archives: linkedlist

Extract Leaves of a Binary Tree in a Doubly Linked List : GeeksforGeeks

Problem link: http://www.geeksforgeeks.org/connect-leaves-doubly-linked-list/

Problem Statement:
Given a Binary Tree, extract all leaves of it in a Doubly Linked List (DLL). Note that the DLL need to be created in-place. Assume that the node structure of DLL and Binary Tree is same, only the meaning of left and right pointers are different. In DLL, left means previous pointer and right means next pointer.
Continue reading

Advertisements

Boundary Traversal of Binary Tree : GeeksforGeeks

Problem link: http://www.geeksforgeeks.org/boundary-traversal-of-binary-tree/

Problem Statement:
Given a binary tree, print boundary nodes of the binary tree Anti-Clockwise starting from the root.
Continue reading

Unfriendly Numbers: Hackerrank

Problem link: https://www.hackerrank.com/challenges/unfriendly-numbers

Problem Statement:
There is one friendly number and N unfriendly numbers. We want to find how many numbers are there which exactly divide the friendly number, but does not divide any of the unfriendly numbers.
Continue reading

FewestFactors : TopCoder Problem 5886

[The problem appeared in TopCoder SRM 272 (Div-1, Level-1) and SRM 271 (Div-2, Level-2)]
Problem link: http://community.topcoder.com/stat?c=problem_statement&pm=5886

Problem Statement:
You will be given some decimal digits in a int[] digits. Build an integer with the minimum possible number of factors, using each of the digits exactly once (be sure to count all factors, not only the prime factors). If more than one number has the same (minimum) number of factors, return the smallest one among them.
Continue reading