Data Structures - Important Questions | Class 12

Chapter 8 - Data Structures in C++

This page contains important questions on Data Structures for Class 12 students. The questions cover data types, primitive and non-primitive data types, different data structures and its types and more.  These questions are useful for AHSEC/ASSEB Class 12 exam preparation

1.What is Data?

Answer :Data means raw facts or values that can be processed by a computer.

For example:

  • 25
  • 45.5
  • “Rahul”
  • A
  • 2026

These values by themselves may not give complete information. After processing, data can become meaningful information

2. What is a Data Type?

Answer :A data type tells the computer what kind of value a variable can store.

3. What are the different categories of Data Types in C++?

Answer :C++ data types can broadly be divided into:

  1. Primitive data types
  2. Non-primitive data types

4. What are primitive data types?

Answer :Primitive data types are the basic data types provided by the programming language. They are used to store a single value.

Some commonly used primitive data types in C++ are:

  • int
  • char
  • float
  • double
  • bool

5.What are non-primitive data types?

Answer :Non-primitive data types are formed using primitive data types. They are generally used to store a collection of values or more complex data.

Examples include:

  • Arrays
  • Structures
  • Classes
  • Linked lists
  • Stacks
  • Queues
  • Trees

6. What is a data structure?

Answer :

A data structure is a particular way of organizing and storing data in a computer so that the data can be accessed and processed efficiently.

In simple words:

A data structure is a method of arranging data in a program so that it can be used efficiently.

7. What are the different types of data structures?

Answer :

Data structures can be classified in different ways.

→ Simple

→ Compound

8.What is a simple data structure?

Answer :

A simple data structure generally deals with a single value.

Examples include:

  • Integer
  • Character
  • Float
  • Double
  • Boolean

9. What is a compound data structure?

Answer :

A compound data structure is formed by combining multiple data elements.

Examples include:

  • Array
  • Structure
  • Stack
  • Queue
  • Linked List
  • Tree

10.What is a linear data structure?

Answer :

In a linear data structure, elements are arranged sequentially, one after another.

Examples:

  • Array
  • Stack
  • Queue

11.What is a non-linear data structure?

Answer :

In a non-linear data structure, elements are not arranged in a single sequence. An element may be connected to more than one other element.

Examples:

  • Tree
  • Graph

12.What is an array?

Answer :

An array is a collection of elements of the same data type stored under one name.

The elements of an array are stored in consecutive memory locations and are accessed using an index.

13. What is a structure?

Answer:

A structure is a user-defined data type that allows us to group different types of data under one name.

13. What is a stack?

Answer:

A stack is a linear data structure in which insertion and deletion take place from the same end, called the top.

A stack follows the principle:

LIFO – Last In, First Out

This means the element inserted last is removed first.

13.What is a queue?

Answer:

A queue is a linear data structure in which insertion and deletion take place at different ends.

A queue follows:

FIFO – First In, First Out

The element inserted first is removed first.

13. What is a linked-list?

Answer:

A linked list is a linear data structure in which elements are stored in separate nodes. The nodes are connected using pointers.

Unlike an array, the elements of a linked list do not have to occupy consecutive memory locations.

Each node generally contains:

  1. Data
  2. A pointer to the next node

13. What is a tree?

Answer:

A tree is a non-linear data structure in which data elements are arranged in a hierarchical manner.

A tree consists of nodes connected by edges.

Trees are commonly used to represent hierarchical information.

Examples include:

  • File and folder systems
  • Organization structures
  • Family trees
  • Searching and sorting applications

13. What is a graph?

Answer:

A graph is another important non-linear data structure. It consists of a collection of vertices (or nodes) connected by edges.

For example:

Graphs can be used to represent:

  • Road networks
  • Computer networks
  • Social networks
  • Connections between web pages

13. What is the difference between linear and non-linear data structures?

Answer:

Linear

Non-Linear

Elements are arranged sequentially.

Elements are arranged hierarchically or as networks.

Generally, each element has a single next element.

An element may be connected to multiple elements.

Traversal is usually sequential.

Traversal can follow different paths.

Examples: Array, Stack, Queue, Linked List

Examples: Tree, Graph

 

Scroll to Top