0% found this document useful (0 votes)
11 views2 pages

Data Structures & Algorithms Exam Guide

This document outlines the exam structure for the Bachelor of Technology in Artificial Intelligence and Data Science at Dr. Babasaheb Ambedkar Technological University for the Data Structure and Algorithm using Python course. It includes instructions for students, a compulsory objective-type question section, and various problem-solving questions across multiple topics related to data structures and algorithms. The exam is designed to assess students' understanding of Python programming, data structures, and algorithmic concepts.

Uploaded by

sarkalekartik42
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

Data Structures & Algorithms Exam Guide

This document outlines the exam structure for the Bachelor of Technology in Artificial Intelligence and Data Science at Dr. Babasaheb Ambedkar Technological University for the Data Structure and Algorithm using Python course. It includes instructions for students, a compulsory objective-type question section, and various problem-solving questions across multiple topics related to data structures and algorithms. The exam is designed to assess students' understanding of Python programming, data structures, and algorithmic concepts.

Uploaded by

sarkalekartik42
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

DR.

BABASAHEB AMBEDKAR TECHNOLOGICAL UNIVERSITY, LONERE


Bachelor of Technology (Artificial Intelligence and Data Science) SEMESTER - 3 Summer 2025 ( Supply. )
Course :Bachelor of Technology (Artificial Intelligence and Data Science) Branch : Engineering and Technology
Semester : SEMESTER - 3
Subject Code & Name: BTAIC303 - DATA STRUCTURE AND ALGORITHM USING PYTHON
025335399

025335399

025335399
Time : 3 Hours] [Total Marks : 60

Instructions to the Students:


[Link] question carries 12 marks.
[Link] No. 1 will be compulsory and include objective-type questions.
[Link] are required to attempt any four questions from Question No. 2 to Question
No.6
[Link] of non-programmable scientific calculators is allowed.
[Link] suitable data wherever necessary and mention it clearly.

Q1. Objective type questions. (Compulsory Question) 12


1 How is a code block indicated in Python?
a. Brackets b. Indentation c. Key d. None
025335399

025335399

025335399
2 What will be the output of the following code ?
a=3 b=1
print(a,b)
a,b=b,a
print(a,b)
a. 3 1 1 3 b. 3 1 3 1 c. 1 3 1 3 d. 1 3 3 1
3 Which of the following blocks will always be executed whether anexception is
encountered or not in a program?
a. try b. except c. finally d. catch
4 What is fruitful function in Python?
a. functionwhich willreturn value b. functionwhich will notreturn value
c. functionwhich will sendvalue. [Link]
025335399

025335399

025335399

5 5 What will be the Postfix expression for (a+b+c)*d


a. ab+c+d* b. ab+cd+* c. abc++cd* d. None
6 Data Structure is Classified into :
a. Linear b. Non-Linear c. Non-Primitive d. All of these
7 What is a hash table?
a. A structure that maps b. A structure that maps
values to keys keys to values

c. A structure used for d. A structure used to


storage implement stack and queue

8 Which of the following is not a collision resolution technique?


a. Separatechaining b. Linearprobing c. Quadraticprobing d. Hashing
9 For a binary search algorithm to work, it is necessary that the array(list) must be
a. Sorted b. Unsorted c. In Heap d. Popped out of stack
1
10 Binary Search can be categorized into which of the following?
a. Brute Force technique b. Divide-and conquer
c. Greedy method d. Dynamic programming

11 Which sorting is also called divide and conquer sorting?


a. Quick sort b. Bubble sort c. Merge sort d. Both a & c
12 12 What will be the output of the following code.
dict1 = {'first' : 'sunday', 'second' : 'monday'}
025335399

025335399

025335399
dict2={1:3, 2:4}
[Link](dict2)
print(dict1)
a. { 'first':'sunday','second':'monday',1:3, 2:4}
b. {'first':'sunday','second':'monday'}
c. {1: 3, 2: 4}
d. None of these

Q2. Solve the following.


A) Explain features of Python in detail. 6
B) Explain concept of stack with its operations. 6

Q3. Solve the following.


025335399

025335399

025335399
A) Define tree data structure. Explain different types of tree withexamples 6
B) Write an algorithm for bubble sort? Sort following elements withbubble sir 6
45,67,23,13,20,10

Q4. Solve Any Two of the following.


A) Explain concept of Inheritance and its types in python with syntax. 6
B) Construct a Binary search tree for following data and perform inorder, preorder 6
and postorder 20,3,13,16,30,56,10,24,56
C) Write a python program to search element using Binary searchmethod 6

Q5. Solve Any Two of the following.


A) Write an algorithm for quick sort and insertion sort method 6
B) Write a python program to construct BST and perform Preorder treetraversal. 6
025335399

025335399

025335399

C) Explain following a. Abstraction b. encapsulation c. class 6

Q6. Solve Any Two of the following.


A) Convert following infix expression to postfix :a. (x+y)^2 + (a+b)^2 b. (p + q – r ) 6
*( s+t)
B) Explain Linked list and its types with representation. 6
C) Write a python program to perform arithmetic operations usingfunction. 6

* * * End * * *

Common questions

Powered by AI

Inheritance in Python allows a class to inherit properties and behaviors from another class, promoting code reuse and hierarchical class structuring. Types include single inheritance (one superclass), multiple inheritance (multiple superclasses), and multilevel inheritance (chain of classes inherited from one another). It improves the modularity and maintainability of code by allowing existing implementations to be extended or modified rather than rewritten .

Quick sort and merge sort both use divide-and-conquer by recursively dividing the problem into smaller subproblems. Quick sort selects a pivot and partitions the array around it, which can lead to O(n^2) performance in the worst case but is typically faster in practice with O(n log n) average performance than other sorts. Merge sort divides the array into halves, recursively sorts, and then merges, providing a stable O(n log n) performance irrespective of the input state but generally requires more space .

The 'finally' block in Python's exception handling is executed regardless of whether an exception has occurred or not, ensuring that cleanup code such as releasing resources or closing files is executed. This block helps maintain program's stability and consistency by providing a guaranteed way to free resources .

A binary search algorithm requires the input list or array to be sorted. It operates by dividing the array into halves to reduce the search space. The divide-and-conquer classification stems from its method of recursively dividing the problem into smaller subproblems, solving each recursively, and combining solutions to solve the original problem .

A hash table maps keys to values using a hash function, which computes the index in an array where each key-value pair is stored. This allows for average-case constant time complexity, O(1), for lookup, insertion, and deletion operations, making it significantly more efficient than linear structures like arrays or linked lists for these operations .

Primary stack operations include 'push' (insertion of an element), 'pop' (removal of the top element), and 'peek' (viewing the top without removing it). These operations reflect the LIFO principle by ensuring that the last element added ('pushed') is the first one to be removed ('popped').

Indentation in Python is crucial as it defines the scope of loops, functions, and classes. Unlike languages like C++ or Java that use braces '{ }' to determine code blocks, Python relies solely on indentation levels to distinguish between different blocks of code. This enforces readability and a consistent structuring method for all Python programmers .

A postfix expression eliminates the need for parentheses as operators follow their operands, allowing expressions to be evaluated in one left-to-right pass using a stack structure, without the need for precedence rules. This property provides suitability for stack-based machines and compilers due to its unambiguous and efficient evaluation process .

Encapsulation bundles data with methods operating on the data, restricting direct access to some components (e.g., using private variables). Abstraction hides complex details to present only relevant information. Together, they enable clean interfaces and interactions. For example, classes hide internal complexity while providing a public API; a car object might offer drive() without exposing engine mechanics .

A tree data structure consists of nodes, each with potential children, forming a parent-child relationship hierarchy. Unlike more general graphs, trees have no cycles and a single root node. Its types include binary trees (e.g., binary search trees) where each node has at most two children, AVL trees which maintain balanced heights, and B-trees used in databases for balanced storage of information .

You might also like