Sunidhi Bansal has Published 1100 Articles

C++ Program for Bisection Method

Sunidhi Bansal

Sunidhi Bansal

Updated on 20-Dec-2019 13:04:12

13K+ Views

Given with the function f(x) with the numbers a and b where, f(a) * f(b) > 0 and the function f(x) should lie between a and b i.e. f(x) = [a, b]. The task is to find the value of root that lies between interval a and b in function ... Read More

C++ Program for Priority Scheduling

Sunidhi Bansal

Sunidhi Bansal

Updated on 20-Dec-2019 12:43:48

10K+ Views

We are given with the n number of processes i.e. P1, P2, P3, ......., Pn with their corresponding burst times and priorities associated with each process . The task is to find the average waiting time ,average turnaround time and the sequence of process execution using priority CPU scheduling algorithm.What ... Read More

C++ Program for Best Fit algorithm in Memory Management

Sunidhi Bansal

Sunidhi Bansal

Updated on 20-Dec-2019 12:30:51

4K+ Views

Given two arrays containing block size and process size; the task is to print the results according to Best Fit algorithm in memory management.What is Best Fit Algorithm?Best Fit is a memory management algorithm; it deals with allocating smallest free partition which meets the requirement of the requesting process. In ... Read More

C++ Program for Optimal Page Replacement Algorithm

Sunidhi Bansal

Sunidhi Bansal

Updated on 20-Dec-2019 12:20:43

4K+ Views

Given page number and page size; the task is to find number of hits and misses as when we allocate the memory block to a page using Optimal Page Replacement Algorithm.What is Optimal Page Replacement Algorithm?Optimal page replacement algorithm is a page replacement algorithm. A page replacement algorithm is an ... Read More

Java Program for credit card number validation

Sunidhi Bansal

Sunidhi Bansal

Updated on 20-Dec-2019 11:42:07

5K+ Views

Given a long number containing digits of a credit card number; the task is to find whether the credit card number is valid or not with a program.For checking a credit card is valid or not, the following are the validations we have to be sure for declaring the result.A ... Read More

C++ Program for Derivative of a Polynomial

Sunidhi Bansal

Sunidhi Bansal

Updated on 20-Dec-2019 11:32:06

4K+ Views

Given a string containing the polynomial term, the task is to evaluate the derivative of that polynomial.What is a Polynomial?Polynomial comes from two words: - “Poly” which means “many” and “nomial” means “terms”, which comprises many terms. Polynomial expression is an expression containing variables, coefficients and exponents, which only involves ... Read More

C Program for focal length of a lens

Sunidhi Bansal

Sunidhi Bansal

Updated on 20-Dec-2019 11:20:43

264 Views

Given two floating values; image distance and object distance from a lens; the task is to print the focal length of the lens.What is focal length?Focal length of an optical system is the distance between the center of lens or curved mirror and its focus.Let’s understand with the help of ... Read More

Program for Mobius Function in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 20-Dec-2019 11:17:22

318 Views

Given a number n; the task is to find the Mobius function of the number n.What is Mobius Function?A Mobius function is number theory function which is defined by$$\mu(n)\equiv\begin{cases}0\1\(-1)^{k}\end{cases}$$n=  0 If n has one or more than one repeated factorsn= 1 If n=1n= (-1)k  If n is product of k ... Read More

C Program for Hexagonal Pattern

Sunidhi Bansal

Sunidhi Bansal

Updated on 21-Nov-2019 12:28:19

1K+ Views

We are given with an integer ‘n’ and the task is to generate the hexagonal pattern and display the final output.ExampleInput-: n=5 Output-:Input-: n = 4 Output-:Approach we are using in the given program is as follows −Input the number ‘n’ from userDivide the entire pattern into three parts i.e. ... Read More

Java program to convert Byte array to IP Address

Sunidhi Bansal

Sunidhi Bansal

Updated on 20-Nov-2019 13:10:10

740 Views

Given with a Byte array ad the task is to convert it into an IP address using the IPAddress class in java and display the result.What is a Byte ArrayA byte comprises of 8 bits and byte array comprises of contiguous bytes which stores the binary information. In java, byte ... Read More

Advertisements