# Tag Archives: DFS

Given a Generic Tree consisting of N nodes valued from 0 to (N – 1) where P[i]th in the array P[] denotes ith nodes parent(1-based… Read More
Given a tree consisting of N nodes an array edges[] of size N – 1 such that for each {X, Y, W} in edges[] there… Read More
Given a Binary Tree consisting of N nodes having no values in it and an integer X, that represents the value of the root node,… Read More
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and… Read More
Given a Generic Tree consisting of N nodes numbered from 0 to N – 1 which is rooted at node 0 and an array val[]… Read More
Given a generic tree consisting of N nodes, the task is to find the maximum sum of the path from the root to the leaf… Read More
Given a Binary Search Tree, a target node in the BST, and an integer value K, the task is to find the sum of all… Read More
Given a Binary tree, and target sum as K, the task is to print all the possible paths from root to leaf that has the… Read More
Given an N-ary Tree consisting of N nodes valued from [0, N – 1] and two binary arrays initial[] and final[] of size N such… Read More
Given a Generic Tree consisting of N nodes, the task is to find the average width for each node present in the given tree. The… Read More
Given a positive integer N denoting the number of astronauts(labelled from 0 from (N – 1))and a matrix mat[][] containing the pairs of astronauts that… Read More
Given a graph, G consisting of N nodes, a source S, and an array Edges[] of type {u, v} that denotes that there is an… Read More
Given a directed graph G consisting of N nodes and N-1 edges, and a positive integer K, and initially, all the nodes of the graph… Read More
Given a tree consisting of N nodes and rooted at node 1, also given an array Q[] of M pairs, where each array element represents… Read More
Given a binary matrix mat[][] of dimensions N*M, the task is to find the minimum number of flips required from the given binary matrix such… Read More
{"ft_lang_label":"__label__en","ft_lang_prob":0.9006747,"math_prob":0.9619834,"size":248,"snap":"2021-31-2021-39","text_gpt3_token_len":60,"char_repetition_ratio":0.057377048,"word_repetition_ratio":0.0,"special_character_ratio":0.23387097,"punctuation_ratio":0.0,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9882983,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-09-23T15:53:54Z\",\"WARC-Record-ID\":\"<urn:uuid:973728d8-b141-4ace-941e-38b9cd7eaef3>\",\"Content-Length\":\"140300\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:dae6dc46-40a8-4301-83bd-0be971970a5b>\",\"WARC-Concurrent-To\":\"<urn:uuid:242837e1-a4b9-460c-bc8e-58e826de1841>\",\"WARC-IP-Address\":\"44.228.100.190\",\"WARC-Target-URI\":\"https://origin.geeksforgeeks.org/tag/dfs/\",\"WARC-Payload-Digest\":\"sha1:GNIEKAVKZM2K537APR7UKKQ6KNTSM4KQ\",\"WARC-Block-Digest\":\"sha1:QG3JL7QQHRT32R342Z7OFZLW4OSHNSKP\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-39/CC-MAIN-2021-39_segments_1631780057424.99_warc_CC-MAIN-20210923135058-20210923165058-00399.warc.gz\"}"}