Sudhir sharma has Published 1206 Articles

An interesting time complexity question in C++

sudhir sharma

sudhir sharma

Updated on 24-Oct-2019 08:09:38

792 Views

Time complexity can be defined as the time required by the algorithm to run its average case.Let's see and calculate the time complexity of some of the basic functions.Methodvoid counter(int n){    for(int i = 0 ; i < n ; i++){       for(int j = 1 ; j

An interesting method to print reverse of a linked list in C++

sudhir sharma

sudhir sharma

Updated on 24-Oct-2019 08:05:25

86 Views

A linked list is a data structure that stores data elements in linked form. Each node of the linked list has a data element and a link.Print reverse of a linked list is a common problem that needs to be addressed in problem solving. So, here we will learn an ... Read More

An Insertion Sort time complexity question in C++

sudhir sharma

sudhir sharma

Updated on 24-Oct-2019 08:01:24

844 Views

What is the time complexity of insertion sort?Time complexity is the amount of time taken by a set of codes or algorithms to process or run as a function of the amount of input.For insertion sort, the time complexity is of the order O(n) i.e. big O of n in ... Read More

Amortized analysis for increment in counter in C++

sudhir sharma

sudhir sharma

Updated on 24-Oct-2019 07:54:31

405 Views

Amortized analysis for a sequence of operations is used to determine the run time, the average time required by the sequence. In cannot be treated as an average-case analysis done on the algorithm as it does not always take the average case scenario. There are cases that occur as a ... Read More

Amazing hacks of Python

sudhir sharma

sudhir sharma

Updated on 24-Oct-2019 07:49:28

119 Views

Python is an amazing programming language that can do many interesting things due to its huge set of libraries. Here are some common hacks and things that will be helpful to you while programming.SSPrinting the same character multiple times in python.Printing repeated character by typing the same character set as ... Read More

Area of a polygon with given n ordered vertices in C++

sudhir sharma

sudhir sharma

Updated on 16-Oct-2019 07:59:36

780 Views

In this program, we have to find the area of a polygon. The coordinates of the vertices of this polygon are given. Before we move further lets brushup old concepts for a better understanding of the concept that follows.The area is the quantitative representation of the extent of any two-dimensional ... Read More

Area of a n-sided regular polygon with given side length in C++

sudhir sharma

sudhir sharma

Updated on 16-Oct-2019 07:56:49

764 Views

In this problem for finding the area of an n-sided regular polygon with a given side, we will derive the formula for the area of the figure and create a program based on it. But before that let's revise the basics to understand the topic easily.An N-sided regular polygon is ... Read More

Area of a Circumscribed Circle of a Square in C++

sudhir sharma

sudhir sharma

Updated on 16-Oct-2019 07:54:12

125 Views

In this problem, we will calculate the area of the circumscribed circle of a square when we are given the side of the square. Before we go further let’s revise the basic definitions to understand the concepts better.Square is a quadrilateral with all sides equal.The circumscribing circle is a circle ... Read More

Alternative Sorting in C++

sudhir sharma

sudhir sharma

Updated on 16-Oct-2019 07:50:14

570 Views

Sorting the elements of an integer array in such a way that the first element is the maximum of the array and the second element of the sorted array is the minimum, the third one is the second minimum, the fourth one is the second maximum of the array and ... Read More

Alternate sorting of Linked list in C++

sudhir sharma

sudhir sharma

Updated on 16-Oct-2019 07:46:07

145 Views

A linked list is a linear data structure that stores elements and also stores a pointer to the next data node.In this problem on the sorting of a linked list, the alternate sort means sorting in such a way that the 1st node contains data with the minimum value, the ... Read More

Advertisements