← Cognizant questions

Boundary nodes sum

Filed under Cognizant

Given a binary tree, calculate the sum of all nodes located on its boundary. The boundary includes the root, the left boundary (excluding leaves), all leaf nodes from left to right, and the right…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Cognizant questions

Collected from public candidate posts and coding forums. Updated Nov 2026.