Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/harshitsahu2311/all-year-practicals
In this repo I have completed and uploaded my all 2nd year practicals of my college.
https://github.com/harshitsahu2311/all-year-practicals
computer-networks data-structures operating-system python
Last synced: about 1 month ago
JSON representation
In this repo I have completed and uploaded my all 2nd year practicals of my college.
- Host: GitHub
- URL: https://github.com/harshitsahu2311/all-year-practicals
- Owner: harshitsahu2311
- Created: 2022-09-25T16:52:21.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-13T14:37:28.000Z (9 months ago)
- Last Synced: 2024-05-13T15:29:35.652Z (9 months ago)
- Topics: computer-networks, data-structures, operating-system, python
- Language: C++
- Homepage:
- Size: 110 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# All-Years-Practicals
## ARTIFICIAL INTELLIGENCE PRACTICALS
1. Write a prolog program to calculate the sum of two numbers.
2. Write a Prolog program to implement max(X, Y, M) so that M is the maximum of two numbers X and Y.
3. Write a program in PROLOG to implement factorial (N, F) where F represents the factorial of a number N.
4. Write a program in PROLOG to implement generate_fib(N,T) where T represents the Nth term of the fibonacci series.
5. Write a Prolog program to implement GCD of two numbers.
6. Write a Prolog program to implement power (Num,Pow, Ans) : where Num is raised to the power Pow to get Ans.
7. Prolog program to implement multi (N1, N2, R) : where N1 and N2 denotes the numbers to be multiplied and R represents the result.
8. Write a Prolog program to implement memb(X, L): to check whether X is a member of L or not.
9. Write a Prolog program to implement conc (L1, L2, L3) where L2 is the list to be appended with L1 to get the resulted list L3.
10. Write a Prolog program to implement reverse (L, R) where List L is original and List R is reversed list.
11. Write a program in PROLOG to implement palindrome (L) which checks whether a list L is a palindrome or not.
12. Write a Prolog program to implement sumlist(L, S) so that S is the sum of a given list L.
13. Write a Prolog program to implement two predicates evenlength(List) and oddlength(List) so that they are true if their argument is a list of even or odd length
respectively.
14. Write a Prolog program to implement nth_element (N, L, X) where N is the desired position, L is a list and X represents the Nth element of L.
15. Write a Prolog program to implement maxlist(L, M) so that M is the maximum number in the list.
16. Write a prolog program to implement insert_nth (I, N, L, R) that inserts an item I into Nth position of list L to generate a list R.
17. Write a Prolog program to implement delete_nth (N, L, R) that removes the element on Nth position from a list L to generate a list R.
18. Write a program in PROLOG to implement merge (L1, L2, L3) where L1 is first ordered list and L2 is second ordered list and L3 represents the merged list.## PYTHON PRACTICALS
1. WAP to find the roots of a quadratic equation
2. WAP to accept a number 'n' and
- Check if 'n' is prime
- Generate all prime numbers till 'n'
- Generate first 'n' prime numbers
This program may be done using functions3. WAP to create a pyramid of the character "*" and a reverse pyramid
![python2](https://user-images.githubusercontent.com/101046816/192342609-7dab8fda-c0f5-4f02-b5a3-6fa1ec75b506.jpeg)4. WAP that accepts a character and performs the following:
- print whether the character is a letter or numeric digit or a special character
- if the character is a letter, print whether the letter is uppercase or lowercase
- if the character is a numeric digit, prints its name in text (e.g., if input is 9, output is NINE)5. WAP to perform the following operations on a string :-
- Find the frequency of a character in a string.
- Replace a character by another character in a string.
- Remove the first occurrence of a character from a string.
- Remove all occurrences of a character from a string.6. WAP to swap the first n characters of two strings.
7. Write a function that accepts two strings and returns the indices of all the occurrences of the second string in the first string as a list.
If the second string is not present in the first string then it should return -1.8. WAP to create a list of the cubes of only the even integers appearing in the input list (may have elements of other types also) using the following:
- 'for' loop
- list comprehension9. WAP to read a file and
- Print the total number of characters, words and lines in the file.
- Calculate the frequency of each character in the file. Use a variable of dictionary type to maintain the count.
- Print the words in reverse order.
- Copy even lines of the file to a file named ‘File1’ and odd lines to another file named ‘File2’.10. WAP to define a class Point with coordinates x and y as attributes. Create relevant methods and print the objects. Also define a method
distance to calculate the distance between any two point objects.11. Write a function that prints a dictionary where the keys are numbers between 1 and 5 and the values are cubes of the keys.
12. Consider a tuple t1=(1, 2, 5, 7, 9, 2, 4, 6, 8, 10). WAP to perform following operations:
- Print half the values of the tuple in one line and the other half in the next line.
- Print another tuple whose values are even numbers in the given tuple.
- Concatenate a tuple t2=(11,13,15) with t1.
- Return maximum and minimum value from this tuple13. WAP to accept a name from a user. Raise and handle appropriate exception(s) if the text
entered by the user contains digits and/or special characters.## OPERATING SYSTEM PRACTICALS
1. Write a program (using fork() and/or exec() commands) where parent and child execute:
- same program, same code.
- same program, different code.
- before terminating, the parent waits for the child to finish its task.
2. Write a program to report behaviour of Linux kernel including kernel version, CPU type and
model. (CPU information)
3. Write a program to report behaviour of Linux kernel including information on 19 configured
memory, amount of free and used memory. (memory information)
4. Write a program to print file details including owner access permissions, file access time,
where file name is given as argument.
5. Write a program to copy files using system calls.
6. Write a program to implement FCFS scheduling algorithm.
7. Write a program to implement Round Robin scheduling algorithm.
8. Write a program to implement SJF scheduling algorithm.
9. Write a program to implement non-preemptive priority based scheduling algorithm.
10. Write a program to implement preemptive priority based scheduling algorithm.
11. Write a program to implement SRJF scheduling algorithm.
12. Write a program to calculate sum of n numbers using thread library.
13. Write a program to implement first-fit, best-fit and worst-fit allocation strategies.## COMPUTER NETWORKS PRACTICALS
1. Simulate Cyclic Redundancy Check (CRC) error detection algorithm for noisy channel.
2. Simulate and implement stop and wait protocol for noisy channel.
3. Simulate and implement go back n sliding window protocol.
4. Simulate and implement selective repeat sliding window protocol.
5. Simulate and implement distance vector routing algorithm
6. Simulate and implement Dijkstra algorithm for shortest path routing.## DATA STRUCTURE PRACTICALS
1. Write a program to search an element from a list. Give user the option to perform Linear or
Binary search. Use Template functions.
2. WAP using templates to sort a list of elements. Give user the option to perform sorting using
Insertion sort, Bubble sort or Selection sort.
3. Implement Linked List using templates. Include functions for insertion, deletion and search of
a number, reverse the list and concatenate two linked lists (include a function and also overload operator +).
4. Implement Doubly Linked List using templates. Include functions for insertion, deletion and
search of a number, reverse the list.
5. Implement Circular Linked List using templates. Include functions for insertion, deletion and
search of a number, reverse the list.
6. Perform Stack operations using Linked List implementation.
7. Perform Stack operations using Array implementation. Use Templates.
8. Perform Queues operations using Circular Array implementation. Use Templates.
9. Create and perform different operations on Double-ended Queues using Linked List implementation.
10. WAP to scan a polynomial using linked list and add two polynomial.
11. WAP to calculate factorial and to compute the factors of a given no.
- using recursion
- using iteration
12. WAP to display fibonacci series
- using recursion
- using iteration
13. WAP to calculate GCD of 2 number
- with recursion
- without recursion
14. WAP to create a Binary Search Tree and include following operations in tree:
- Insertion (Recursive and Iterative Implementation)
- Deletion by copying
- Deletion by Merging
- Search a no. in BST
- Display its preorder, postorder and inorder traversals Recursively
- Display its preorder, postorder and inorder traversals Iteratively
- Display its level-by-level traversals
- Count the non-leaf nodes and leaf nodes
- Display height of tree
- Create a mirror image of tree
- Check whether two BSTs are equal or not
15. WAP to convert the Sparse Matrix into non-zero form and vice-versa.
16. WAP to reverse the order of the elements in the stack using additional stack.
17. WAP to reverse the order of the elements in the stack using additional Queue.
18. WAP to implement Diagonal Matrix using one-dimensional array.
19. WAP to implement Lower Triangular Matrix using one-dimensional array.
20. WAP to implement Upper Triangular Matrix using one-dimensional array.
21. WAP to implement Symmetric Matrix using one-dimensional array.
22. WAP to create a Threaded Binary Tree as per inorder traversal, and implement operations
like finding the successor / predecessor of an element, insert an element, inorder traversal.
23. WAP to implement various operations on AVL Tree.
24. WAP to implement heap operations