Posts

Showing posts with the label Questions

TCS Codevita Preparations - Old is Gold

Image
Hello All,                   Hope you would like to sharp your mind and solve some questions that might help you in your career. http://alltricks007.blogspot.in/2017/06/tcs-codevita-n-queen-problem-with.html http://alltricks007.blogspot.in/2017/03/tcs-codevita-2016-round1-question.html http://alltricks007.blogspot.in/2017/03/tcs-codevita-2016-round1-question-logic.html http://alltricks007.blogspot.in/2017/03/tcs-codevita-2016-round1-question-min.html http://alltricks007.blogspot.in/2017/06/tcs-codevita-credit-and-risk-calculator.html http://alltricks007.blogspot.com/2017/06/tcs-codevita-reverse-gear-solution.html http://alltricks007.blogspot.in/2017/06/tcs-codevita-minimum-distance-solution.html http://alltricks007.blogspot.in/2017/06/tcs-codevita-recurring-deposit-question.html http://alltricks007.blogspot.in/2017/06/tcs-codevita-old-quistions.html http://alltricks007.blogspot.in/2017/06/tcs-codevita-question-milkman-and-hi...

TCS CODEVITA old Questions

Problem : Online Communities - Even Groups-2014 In a social network, online communities refer to the group of people with an interest towards the same topic. People connect with each other in a social network. A connection between Person  I  and Person  J  is represented as  C I J . When two persons belonging to different communities connect, the net effect is merger of both communities which I and J belonged to. We are only interested in finding out the communities with the member count being an even number. Your task is to find out those communities. Input Format: Input will consist of three parts, viz. 1. The total number of people on the social network  (N) 2.Queries  C I J , connect I and J Q 0 0 , print the number of communities with even member-count -1 will represent end of input. Output Format: For each query Q, output the number of communities with even member-count Constraints: 1<=N<=10^6 1<=I, J...