Which of the following is a non-linear data structure?
Correct answer B. Tree
Explanation
In a linear structure each element has at most one predecessor and one successor, so the elements form a single sequence; stacks, queues and linked lists all fit this pattern. A tree is non-linear because one node can have several children, creating a branching hierarchy. Graphs are the other common non-linear structure, where any vertex may connect to many others.
Answer checked How we write and check questions
Discussion