Pavitra has Published 176 Articles

Selection Sort in Python Program

Pavitra

Pavitra

Updated on 26-Sep-2019 11:49:07

267 Views

In this article, we will learn about the Selection sort and its implementation in Python 3.x. Or earlier.In selection sort algorithm, an array is sorted by recursively finding the minimum element from the unsorted part and inserting it at the beginning. Two subarrays are formed during the execution of Selection ... Read More

Linear Search in Python Program

Pavitra

Pavitra

Updated on 26-Sep-2019 08:11:37

14K+ Views

In this article, we will learn about the Linear Search and its implementation in Python 3.x. Or earlier.AlgorithmStart from the leftmost element of given arr[] and one by one compare element x with each element of arr[]If x matches with any of the element, return the index value.If x doesn’t ... Read More

Insertion Sort in Python Program

Pavitra

Pavitra

Updated on 26-Sep-2019 08:05:33

942 Views

In this article, we will learn about the implementation of Insertion sort in Python 3.x. Or earlier.AlgorithmIterate over the input elements by growing the sorted array at each iteration.Compare the current element with the largest value available in the sorted array.If the current element is greater, then it leaves the ... Read More

GCD of more than two (or array) numbers in Python Program

Pavitra

Pavitra

Updated on 26-Sep-2019 07:59:28

132 Views

In this article, we will learn about the solution to the problem statement given below −Problem statementWe will be given an array of number and we need to find the greatest common divisor.If we need to find gcd of more than two numbers, gcd is equal to the product of ... Read More

Finding the vertex, focus and directrix of a parabola in Python Program

Pavitra

Pavitra

Updated on 26-Sep-2019 07:46:33

126 Views

In this article, we will learn about the solution to the problem statement given below −Problem statementThe standard form of a parabola equation is y=ax^2+bx+c. Input the values of a, b and c, our task is to find the coordinates of the vertex, focus and the equation of the directrix.The ... Read More

Find the perimeter of a cylinder in Python Program

Pavitra

Pavitra

Updated on 26-Sep-2019 07:43:38

292 Views

In this article, we will learn about the solution to the problem statement given below −Problem statementInput diameter and height, find the perimeter of a cylinder.Perimeter is nothing but the side view of a cylinder i.e. a rectangle.Therefore Perimeter= 2 * ( h + d )here d is the diameter ... Read More

Python Program for Find sum of Series with the n-th term as n^2 – (n-1)^2

Pavitra

Pavitra

Updated on 26-Sep-2019 07:34:20

248 Views

In this article, we will learn about the solution to the problem statement given below:Problem statementWe are given an integer input n and we need to sum of all n terms where the n-th term in a series as expressed below −Tn = n2 - (n-1)2We have direct formulas for ... Read More

Python Program for Find sum of odd factors of a number

Pavitra

Pavitra

Updated on 26-Sep-2019 07:32:00

540 Views

In this article, we will learn about the solution to the problem statement given below −Problem statementGiven a number input n, the task is to Find the sum of odd factors of a number.Here we first need to eliminate all the even factors.To remove all even factors, we repeatedly divide ... Read More

Python Program for Find reminder of array multiplication divided by n

Pavitra

Pavitra

Updated on 26-Sep-2019 07:25:13

577 Views

In this article, we will learn about the solution to the problem statement given below −Problem statementGiven multiple numbers and a number input n, we need to print the remainder after multiplying all the number divisible by n.ApproachFirst, compute the remainder like arr[i] % n. Then multiply this remainder with ... Read More

Python Program for Find minimum sum of factors of number

Pavitra

Pavitra

Updated on 26-Sep-2019 07:18:50

533 Views

In this article, we will learn about the solution to the problem statement given below −Problem statementGiven a number input , find the minimum sum of factors of the given number.Here we will compute all the factors and their corresponding sum and then find the minimum among them.So to find ... Read More

Advertisements