Engineering
- Write short notes on : Job sequencing with deadlines. Job sequencing with deadlines is a greedy method that picks jobs in decreasing order of profit and puts each one in the latest free time slo... 1
- Explain how backtracking is used for solving n- queens problem. Show the state space tree. Backtracking places queens one row at a time and undoes (backtracks) a placement as soon as no safe column is left for the next row. Problem... 1
- write a detailed note on Hamiltonian cycles. A Hamiltonian cycle is a cycle in a graph that visits every vertex exactly once and returns to the starting vertex. Definition. For a graph... 1
- What do you understand by NP Complete? Explain is subset sum problem NP complete? If so explain A problem is NP-complete if it is in NP and every problem in NP can be reduced to it in polynomial time. Yes, the subset sum problem is NP-c... 1
- Explain different string matching algorithms. String matching finds all occurrences of a pattern P (length m) in a text T (length n). The main algorithms are the naive method, Rabin–Karp... 1
- Sort the list of the elements 10,5,7,6,1,4,8,3,2,9 using merge sort algorithm Sorted list: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10. Merge sort satisfies T(n) = 2T(n/2) + cn, which gives O(nlog n). Divide (mid = ⌊(low + high)/2⌋,... 1
- Solve sum of subsets problem for following 10M N=6 W={3,5,7,8,9,15} & M=20 Also write the Algorithm for it. Solutions: 3, 8, 9, 5, 7, 8 and 5, 15, i.e. x = (1,0,0,1,1,0), (0,1,1,1,0,0) and (0,1,0,0,0,1). Given n = 6, W = \3, 5, 7, 8, 9, 15\ (alread... 1
- Explain with example how divide and conquer strategy is used in binary Search? Binary search divides a sorted array into two halves, compares the key with the middle element, and conquers by searching only the half that... 1
- What is backtracking Approach? Explain how it is used in Graph Coloring Backtracking builds a solution step by step and abandons ("backtracks" from) a partial solution as soon as it cannot lead to a valid answer.... 1
- Determine the frequency counts for all statement in the following algorithm Segment Total frequency count = 3n + 2, so the time complexity is O(n). StatementFrequency count I = 1;1 while (I <= n) n + 1 X = X + I; n I = I + 1... 1
- Explain the general procedure of divide and conquer method The Divide and Conquer method is the most widely applicable technique for designing efficient algorithms. It works in three stages, as shown... 1
- Write the difference between greedy method and dynamic programming Greedy method Dynamic programming Does not guarantee an optimal solution Guarantees an optimal solution Assumes sub-problems do not overlap... 1
- What are different math operators used in Python? Describe all different types of math operators used in Python. Answer: Python has arithmetic, assignment, comparison (relational), logical, identity, membership and bitwise operators. 1. Arithmetic opera... 2
- Write a Python Program to Solve Quadratic Equation import cmath a = 1 b = 5 c = 6 # calculate the discriminant d = (b**2) - (4*a*c) # find two solutions sol1 = (-b-cmath.sqrt(d))/(2*a) sol2 =... 1
- Write a Python Program to Find the Square Root num = float(input('Enter a number: ')) num_sqrt = num ** 0.5 print('The square root of %0.3f is %0.3f'%(num ,num_sqrt)) 1
- Write A Python Program to Calculate Gross Salary of Employee ? Answer: Gross salary = Basic + DA + HRA, where DA = Basic × DA% / 100 and HRA = Basic × HRA% / 100. Steps Read name, company, basic salary a... 1
- Create a Gross Salary Calculator using Python with Streamlit Answer: Build a Streamlit page that takes basic salary, DA% and HRA% with st.number_input and shows Gross = Basic + DA + HRA with st.write.... 1
- write a program for selection sort in c & python Answer: Selection sort repeatedly finds the smallest element of the unsorted part and swaps it into the next position; it needs n-1 passes a... 2
- Write a Python program to find those numbers which are divisible by 7 and multiple of 5, between 1500 and 2700 print("numbers divisible by 7 & 5 are :") for i in range(1500,2701): if i%5==0 and i%7==0: print(" number ",i) 1
- Write a Python program to get the Fibonacci series between 0 to 50. Answer: Generate Fibonacci terms and keep printing while the term is 50 or less. Output: 0 1 1 2 3 5 8 13 21 34 a, b = 0, 1 print("Fibonacci... 1
- What are the three main purposes of an operating system? The three main purposes of an operating system (OS) are: Convenience: An operating system should be convenient for users to interact with an... 1
- Write a detailed note on the evolution of operating systems. Answer: Operating systems evolved from no OS (manual operation) to batch systems, multiprogramming, time-sharing, personal-computer, network... 2
- Differentiate between monolithic, layered and microkernel structure of OS. StructureDescriptionAdvantagesDisadvantages MonolithicA monolithic operating system is a single, large program that includes all of the oper... 1
- Define system call? What are there different categories? Explain using suitable examples. A system call is a mechanism that allows user-level programs to request services from the operating system kernel. It provides a way for pro... 1