Team MCK
Loop Control Structures in C
Loop Control Structures in C
Sometimes we may come across a case where we need to perform a task multiple times. In that case we...
Conditional Flow Control Structures in C
Conditional Flow Control Structures in C
There may be a situation where we have to choose one of the alternative paths depending upon the result...
Split nodes of a linked list into two halves
Split nodes of a linked list into two halves
Problem statement: Given a linked list split it into two halves, front and back. If the...
Count the triplets in C
Count the triplets in C
Problem statement: Given an Array of distinct integers, count all the triplets such that the sum of two elements equals...
Print Inversions in an array in C
Print Inversions in an array in C
Problem statement: Print Inversions in an array. In an array two elements a and a form an inversion...
First C Program
We will write our first C program.
Here, #include is a preprocessor directive.
<stdio.h> is the C standard Input Output library. It is used to getting...
Reverse a string using stack
Problem Statement: Reverse a string using stack in C.
Here we have used an array to implement the stack.
/*Reverse a string using stack. Implement your...
Rearrange an array such that arr[i] = i in C
Problem statement
Consider an array having N elements. Rearrange the array such that A = i and if i is not present, replace it with...
Cyclically rotate an array by k elements in C
Problem statement: Cyclically rotate an array by k elements in C
Example:
input = {1, 2, 3, 4, 5, 6};
Key = 2
output = { 3, 4,...
Cyclically rotate an array by one in C
Problem statement: Cyclically rotate an array by one in C
Example:
input = {1, 2, 3, 4, 5, 6};
output = {6, 1, 2, 3, 4, 5};
...