Skip to content

Punjab (PTB) · Chapter test · Free

1st Year Computer Chapter 4 TestComputational Structures

30 marks · 40 minutes · 21 questions. Covers: CHAP 4:Computational Structures.

Your school name

1st Year Computer Chapter 4 Test

1st Year · Computer · Punjab (PTB)

Name: ____________Roll No: ________Class/Section: ________Date: ________Total marks: 30Time: 40 minutes

Q1. Multiple choice questions (Attempt all · 10 × 1 = 10)

  1. Which graph allows movement in only one direction between two nodes?

    1. Undirected graph

    2. Weighted graph

    3. Circular graph

    4. Directed graph

  2. Which data structure has a root node and follows a hierarchy?

    1. Graph

    2. Queue

    3. Stack

    4. Tree

  3. In Python, which data structure can be used to simulate a queue?

    1. Tuple

    2. List

    3. Set

    4. Dictionary

  4. Lists are helpful in implementing which of the following?

    1. Arrays only

    2. Graphs only

    3. Stack and Queue

    4. None of the above

  5. What are the components of a graph?

    1. Roots and branches

    2. Nodes and files

    3. Vertices and edges

    4. Parents and children

  6. Which of the following best represents a leaf node?

    1. Node with one child

    2. Node with multiple children

    3. Node without children

    4. Node with a parent only

  7. Which function is used to remove the first occurrence of an item from a list by value?

    1. delete( )

    2. pop( )

    3. erase( )

    4. remove( )

  8. What is the function of edges in a tree?

    1. Store data

    2. Connect nodes

    3. Delete nodes

    4. Sort data

  9. Which traversal method is used when deleting a file system?

    1. Pre-order

    2. In-order

    3. Post-order

    4. Level-order

  10. An operation that removes an item from the top of the stack:

    1. Push

    2. Pop

    3. Peek

    4. Add

Q2. Short questions (Attempt any 6 of 8 · 6 × 2 = 12)

  1. What is a graph in data structures?

  2. What is a vertex in a graph?

  3. Which function is used to insert an item at a specific position in a list?

  4. Name two basic operations performed on stack.

  5. What is a list in Python?

  6. What is the difference between enqueue( ) and dequeue( ).

  7. What is a leaf in a tree structure?

  8. What does it mean that Python lists have dynamic size?

Q3. Long questions (Attempt any 2 of 3 · 2 × 4 = 8)

  1. Explain the operations on stack with real-life example and Python code.

  2. Explain the lists are used in implementing stack and queue data structures, including their practical uses in computer science. 

  3. Explain the main types of graphs with examples. Also describe the key characteristics and properties of graphs.