Example – simple quiz

As an example of a binary tree, a simple quiz application will be used. The quiz consists of a few questions and answers, shown depending on the previously-taken decisions. The application presents the question, waits until the user presses Y (yes) or N (no), and proceeds to the next question or shows the answer.

The structure of the quiz is created in the form of a binary tree, as follows:

At the beginning, the user is asked whether he or she has any experience in application development. If so, the program asks whether he or she has worked as a developer for more than five years. In the case of a positive answer, the ...

Get C# Data Structures and Algorithms now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.