Pavitra has Published 177 Articles

Python Program for Odd-Even Sort / Brick Sort

Pavitra

Pavitra

Updated on 20-Dec-2019 06:43:29

189 Views

In this article, we will learn about the solution to the problem statement given below.Problem statement − We are given an array, we need to sort it using brick sort.Here we have two phases: Odd and Even Phase. In the odd phase, bubble sort is performed on odd indexed elements ... Read More

Python Program for Number of stopping station problem

Pavitra

Pavitra

Updated on 20-Dec-2019 06:39:26

221 Views

In this article, we will learn about the solution to the problem statement given below.Problem statement − We are given that there are 13 intermediate stations between two places A and B. We need to find the number of ways in which a train can be stopped at 2 intermediate ... Read More

Python Program for Min Cost Path

Pavitra

Pavitra

Updated on 20-Dec-2019 06:36:28

613 Views

In this article, we will learn about the solution to the problem statement given below.Problem statement − We are given a cost matrix and a position (m, n), we need to find the cost of minimum cost path to reach (m, n) from (0, 0). Each cell represents a cost ... Read More

Python Program for Merge Sort

Pavitra

Pavitra

Updated on 20-Dec-2019 06:33:27

601 Views

In this article, we will learn about the solution to the problem statement given below.Problem statement − We are given an array, we need to sort it using the concept of merge sortHere we place the maximum element at the end. This is repeated until the array is sorted.Now let’s ... Read More

Python Program for Maximum height when coins are arranged in a triangle

Pavitra

Pavitra

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

121 Views

In this article, we will learn about the solution to the problem statement given below.Problem statement − We are given N coins where we need to arrange them in form of a triangle, i.e. in the first row will have 1 coin, the second row will have 2 coins and ... Read More

Python Program for Iterative Quick Sort

Pavitra

Pavitra

Updated on 20-Dec-2019 06:27:27

393 Views

In this article, we will learn about the solution to the problem statement given below.Problem statement − We are given an array, we need to sort it using the concept of quick sort using iterative wayHere we first partition the array and sort the separate partition to get the sorted array.Now ... Read More

Python Program for Iterative Merge Sort

Pavitra

Pavitra

Updated on 20-Dec-2019 06:23:49

434 Views

In this article, we will learn about the solution to the problem statement given below.Problem statement − We are given an array, we need to sort it using the concept of merge sort by iteration.Here we place the maximum element at the end. This is repeated until the array is sorted.Now ... Read More

Python Program for Heap Sort

Pavitra

Pavitra

Updated on 20-Dec-2019 06:17:43

1K+ Views

In this article, we will learn about the solution to the problem statement given below.Problem statement − We are given an array, we need to sort it using the concept of heapsort.Here we place the maximum element at the end. This is repeated until the array is sorted.Now let’s observe the ... Read More

Python Program for Gnome Sort

Pavitra

Pavitra

Updated on 20-Dec-2019 06:13:54

219 Views

In this article, we will learn about the solution to the problem statement given below.Problem statement − We are given an array, we need to sort it using gnome sort.Algorithm1. Firstly we traverse the array from left to right. 2. Now, if the current element is larger or equal to ... Read More

Python Program for Find the closest pair from two sorted arrays

Pavitra

Pavitra

Updated on 20-Dec-2019 06:10:25

133 Views

In this article, we will learn about the solution to the problem statement given below.Problem statement − We are given two arrays, we need to find the closest pair from the two sorted arraysNow let’s observe the solution in the implementation below −Example Live Demo# sys module import sys # pair def ... Read More

Previous 1 ... 5 6 7 8 9 ... 18 Next
Advertisements