Featured Article

Control Statements in C

Control statements in C are used to control the flow of program execution based on certain conditions. There are three main types of control statements in C: conditional statements, loop statements, and jump statements. 1. Conditional Statements: Conditional statements allow a program to make decisions based on whether a certain condition is true or false. The most common… Read More »

Featured Article

Characteristics or features of an Algorithm

Algorithm is a step-by-step procedure which is used to solve a problem. It is important Computer Science and Software Engineering. We can improve our program efficiency in cost and time by choosing appropriate algorithm and data structures for a particular program. An algorithm is a sequence of computational steps that transform the input into the output. Definition of… Read More »

Compare Two Lists

In dart programming, Lists are used for the collection of data. We declare just variables instead of declaring a separate variable for each value of the collection. Lists are indexable so that we access the values using index ( starts from 0 ). In this article, we will see how to compare two Lists in the dart.  For… Read More »

Convert Number n to 1 in Minimum Steps

Given a number n (n>=1 && n<=1018), your task is to convert it to 1 in minimum operation and constant space and time complexity. In one operation you can either – Subtract 1 from n if n>1. (or) Divide n by one of its proper divisor. Examples:- Input: n=2 Output: 1 2–>1. first move:- subtract 1 from n… Read More »

Default Parameters in Python Functions

A default parameter is a value provided in function declaration that is automatically assigned by the compiler if caller of the function doesn’t provide a value for the parameter with default value. Following is a simple Python example to demonstrate use of default parameters. We don’t have to write 3 Multiply functions, only one function works by using… Read More »

Check if given string contains Even 1’s and Odd 0’s

In this problem a string is given, our task is to check the string contains even number of 1’s and odd number 0’s or not. Examples: Input : “101010100” Output : Accept Input : “111001010101” Output : Not Accept Approach used in function: we firstly declare set s which contain ‘0’ and ‘1’ and create set of the… Read More »