Subsets with Equal Sum (DFS)

Problem Given a set of natural numbers with N elements, When this set is divided into two subsets, if there is a case where the sum of the elements of the two subsets is equal, “YES” is output, Otherwise, write a program that prints “NO”. The two subsets divisible by two are disjoint sets, and the…

Read More

Subset (DFS)

Problem Given a natural number N, write a program that prints all subsets of a set with elements 1 through N. input The first line is given a natural number N (1<=N<=10). output From the first line, the subsets are printed in the same order as in the output example below, one for each line However…

Read More

Binary Tree Traversal (Depth First Search)

Problem Practice forward and backward traversal of the binary tree as shown in the figure below. output Pre-traversal output: Inter-traversal output: Post-traversal output: Solution Pre traversal Inter traversal Post traversal

Read More

Recursive Binary

Problem Write a program that converts decimal number N into binary number and outputs it. However, it must be output using a recursive function. input The first line is given a decimal number N (1<=N<=1,000). output Print the binary number on the first line. Solution

Read More

Recursive Function

Problem Write a program that outputs 1 to N using a recursive function when a natural number N is input. input In the first line, an integer N (3<=N<=10) is entered. output print on the first line Solution

Read More
Page 3 Of 26