Given a tree with n (n >0 ) nodes where, every node has a list of key-value pairs

Report
Question

Please briefly explain why you feel this question should be reported .

Report
Cancel

Given a tree with n (n >0 ) nodes where, every node has a list of key-value pairs , with following properties:

1) child node will inherit key-value pair from its parent.

2) child node can override key-value pair at parent by creating a replica. You have to print the flattened key-values pairs at given node say m. 1 <= m <= n  Given a key value pair , print all nodes that satisfies this condition.
Example Input: n = 5 , m= C

A [ (name : abc), (id:5), (place:Tirupati) ]

/ B [ (id : 24), ( name : efg) ]

/ \ [(name : xyz) ] C D [(place : Bangalore)]

/ E

Output: [(name: xyz), (id:24), (place : Tirupati)]

in progress 0
Java 3 months 1 Answer 348 views 0

About vinit123

Answer ( 1 )

  1. ritwik

    Please briefly explain why you feel this answer should be reported .

    Report
    Cancel

    It seems like you want your assignment done. And you surely missed the notes in the sidebar. Please show us what code you have written.

Leave an answer

Browse

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>