0% found this document useful (0 votes)
2 views4 pages

Python Practical IMP

The document contains a comprehensive list of programming tasks in Python, covering various data structures and algorithms. It includes tasks related to linked lists, binary search trees, sorting algorithms, graph operations, and basic mathematical calculations. Each task is presented as a question, prompting the implementation of specific functionalities or algorithms.
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)
2 views4 pages

Python Practical IMP

The document contains a comprehensive list of programming tasks in Python, covering various data structures and algorithms. It includes tasks related to linked lists, binary search trees, sorting algorithms, graph operations, and basic mathematical calculations. Each task is presented as a question, prompting the implementation of specific functionalities or algorithms.
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

Q.1) Write a Python Program to Calculate the Average of Numbers in a List.

Q.2) Write a python program to perform following operations on BST. Insert Display

Q.3) Python program to merge two sorted linked lists.

Q.4) Write a program which accepts 6 integer values and prints “DUPLICATES” if any of the

values entered are duplicates otherwise it prints “ALL UNIQUE”.

Example: Let 6 integers are (32, 10, 45, 90, 45, 6) then output “DUPLICATES” to be printed.

Q.5) Write a python program to perform following operations on BST.

Create

Search

Display (Preorder / Inorder / Postorder)

Q.6) Python program for static implementation of Singly Linked List to perform

Insert and Display operations.

Q.7) Write a Python program to add and remove operation on set.

Q.8) Write a python program to perform following operations on Binary Search Tree

i. Create

ii. Count non-leaf nodes

iii. Traversal (Prorder / Inorder / Postorder)

Q.9) Python program for dynamic implementation of Singly Linked List to perform

Insert and Display operations.

Q.10) Write a Python program to find maximum and the minimum value in a set.

Q.11) Python program to create a linked list in the sorted order.

Q.12) Write a python program to create an array of ‘n’ integers and display the array

elements. Access individual elements through indexes.

Q.13) Write a python program to perform following operations on BST

i. Create

ii. Delete

iii. Traversal (Prorder / Inorder / Postorder)

Q.14) Write a python program for implementation of Doubly Linked List to perform

Insert and Display operations.

Q.15) Write a python program to get the number of occurrences of specified elements in an array.

Q.16) Write a python program to perform following operations on Binary Search Tree
i. Create

ii. Count total nodes

iii. Traversal (Prorder / Inorder / Postorder)

Q.17) Python program to create doubly linked list and search the given node in the Linked list.

Q.18) Write a python program to reverse the order of the items in the array.

Q.19) Write a python program to perform following operations on BST.

i. Create

ii. Display

Q.20) Python program to create singly linked list and search the given node in the

Linked list.

Q.21) Write a python program to find sum of all the elements in a list.

Q.22) Write a python program to perform following operations on BST.

i. Insert

ii. Delete

iii. Display (Preorder / Inorder / Postorder)

Q.23) Python program to create singly linked list and reverse the Linked list.

Q.24) Write a python function to calculate the factorial of a number. The function accept the

number as an argument.

Q.25) Write a program to search an element using Linear Search.

Q.26) Write a program to calculate indegree of a graph using adjacency matrix.

Q.27) Write a Python script to generate and print a dictionary that contains a number (between 1

and n) in the form (x : x*x).

Q.28) Write a program to search an element using Binary Search.

Q.29) Write a Python program to calculate outdegree of a graph using adjacency matrix.

Q.30) Write a program to generate Fibonacci numbers using function.

Q.31) Write a Python program to sort given numbers using Bubble Sort algorithms.

Q.32) Write a Python class named Circle constructed by a radius and two methods which will

compute the area and the perimeter of a circle

Q.33) Write a Python script to generate and print a dictionary that contains a number (Between 1

and n) in the form (x, x*x).

Sample Dictionary (n = 5)
Expected Output: {1: 1, 2: 4, 3: 9, 4: 16, 5: 25}.

Q.34) Write a Python program to implement sorting Merge Sort algorithms.

Q.35) Write a Python program to create a class representing a shopping cart. Include methods for

adding and removing items, and calculating the total price.

Q.36) Write a Python script to sort (ascending and descending) a dictionary by value.

Q.37) Write a Python program to search an element in an integer array using Binary Search.

Q.38) Write a Python program to implement sorting Quick Sort algorithms.

Q.39) Write a Python program to implement sorting Insertion Sort algorithms.

Q.40) Write a program to calculate indegree of a graph.

Q.41) Write a Python program to combine two dictionary adding values for common keys.

Sample Dictionary:

d1={'a':100,'b':200,'c':300}

d2={'a':300,'b':200,'d':400}

Sample output: Counter ({'a': 400, 'b': 400, 'd': 400, 'c': 300})

Q.42) Write a program to calculate outdegree of a graph.

Q.43) Write a Python class named rectangle constructed by a radius and two methods which will

compute the area and the perimeter of a circle.

Q.44) Write a Python program to create a list of tuples with the first element as the number and

second element as the square of the number, also display original list in reverse.

Q.45) Write a python code for static implementation of stack.

Q.46) Write a Python program for Evaluation of postfix expression.

Q.47) Write a Python Program to Calculate the Average of Numbers in a Given List.

Q.48) Write a python code for static implementation of queue.

Q.49) Write a python code for dynamic implementation of Stack to perform following operations:

Init, Push, Pop, Isempty, Isfull.

Q.50) Write a python code to copy element 44 and 55 from the following tuple into a new tuple

tuple1 = (11, 22, 33, 44, 55, 66), also display the same tuple in reverse order.

Q.51) Write a python code for simple implementation of priority queue.

Q.52) Write a Python program to convert infix to postfix conversion using stack.

Q.53) Write a Python program to get the 5th element from front and 5th element from last of a

tuple.
Q.54) Write a program to display following pattern.

23

456

7 8 9 10

Q.55) Write a python code for dynamic implementation of linear Queue to perform following

operations: init, enqueue, dequeue, isEmpty, isFull.

Q.56) Write a python code for Implementation of an algorithm that reverses string of characters

using stack and checks whether a string is a palindrome or not.

Q. 57) Write a Python program to find repeated items in a tuple.

Q. 58) Write a python code for implementation of circular queue.

Q.59) Write a python code for Implementation of an algorithm that reverses string of characters

using stack and checks whether a string is a palindrome or not.

Q.60) Write a Python Program to Calculate the Sum of Numbers in a List.

Q.61) Write a program to search an element using Binary Search.

Q.62) Write a python program to get the number of occurrences of specified elements in an array.

Q.63) Write a Python class named Circle constructed by a radius and two methods which will

compute the area and the perimeter of a circle

You might also like