Articles on Trending Technologies

Technical articles with clear explanations and examples

Comparison between Agile Model and other models

Vineet Nanda
Vineet Nanda
Updated on 30-Nov-2021 8K+ Views

In this article, we will compare the properties of the agile paradigm with those of other models.Waterfall Model vs. the Agile ModelWhat is Waterfall methodology, and how does it work?The Waterfall Model is also known as the Liner Sequential Life Cycle Model. Because the Waterfall Model is followed in a sequential sequence, the project development team will only go on to the next phase of development or testing if the previous step has been successfully completed.What is the Agile approach, and how does it work?Agile methodology is a concept that aids in the software development process by allowing for continuous ...

Read More

Reverse a Linked List using C++

Prateek Jangid
Prateek Jangid
Updated on 29-Nov-2021 3K+ Views

In this article, we need to reverse the links with the help of a singly linked list. Our task is to create a function that is capable of reversing the given singly linked list. For exampleInput: Following Linked list : 1->2->3->4->NULL Output: After processing of our function: 4->3->2->1->NULLApproach to find The SolutionThere are different approaches to reverse a linked list. Generally, a simple approach comes to our mind to traverse the list and reverse it while going through it.Simple ApproachWe will go through the linked list in this approach and try to reverse it while going through it.Example#include using ...

Read More

Reverse a Linked List in groups of a Given Size using C++

Prateek Jangid
Prateek Jangid
Updated on 29-Nov-2021 373 Views

In this article, we deal with a singly linked list, and the task is to reverse the list in groups of k. For example −Input: 1->2->3->4->5->6->7->8->NULL, K = 3 Output: 3->2->1->6->5->4->8->7->NULL Input: 1->2->3->4->5->6->7->8->NULL, K = 5 Output: 5->4->3->2->1->8For this problem, one approach that comes to mind is trailing the list and reversing the list when our sublist’s size reaches k and continues.Approach to find The SolutionIn this approach, we will generally traverse through the list and keep a counter to count the number of elements in our sub-list. When the counter reaches the count of k, we reverse that ...

Read More

Reverse a Doubly-Linked List in Groups of a Given Size using C++

Prateek Jangid
Prateek Jangid
Updated on 29-Nov-2021 509 Views

In this problem, we are given a pointer to the head of a linked list and an integer k. In groups of size k, we need to reverse the linked list. For example −Input : 1 2 3 4 5 (doubly linked list), k = 3 Output : 3 2 1 5 4Approach to find The SolutionIn this problem, we are going to make a recursive algorithm to solve this problem. In this approach, we are going to use recursion and solve the problem using that.Example#include using namespace std; struct Node ...

Read More

Reverse a Doubly Linked List using C++

Prateek Jangid
Prateek Jangid
Updated on 29-Nov-2021 841 Views

In this article we have a doubly linked list, and we will explain different approaches to reverse a doubly linked list in C++. For example −Input : {1, 2, 3, 4} Output : {4, 3, 2, 1}There is generally one approach that comes to mind, but we will use two approaches − The normal and unorthodox approach.Normal ApproachIn this approach, we will go through the list, and as we go through it, we reverse it.Example#include using namespace std; class Node {    public:    int data;    Node *next;    Node *prev; }; void reverse(Node **head_ref) ...

Read More

Reversal Algorithm for Right Rotation of an Array using C++

Prateek Jangid
Prateek Jangid
Updated on 29-Nov-2021 868 Views

In this article, we will understand the Reversal algorithm to rotate a given array by k-elements to the right, for example −Input : arr[ ] = { 4, 6, 2, 6, 43, 7, 3, 7 }, k = 4 Output : { 43, 7, 3, 7, 4, 6, 2, 6 } Explanation : Rotating each element of array by 4-element to the right gives { 43, 7, 3, 7, 4, 6, 2, 6 }. Input : arr[ ] = { 8, 5, 8, 2, 1, 4, 9, 3 }, k = 3 Output : { 4, 9, 3, 8, ...

Read More

Reversal Algorithm for Array Rotation using C++

Prateek Jangid
Prateek Jangid
Updated on 29-Nov-2021 387 Views

In the given problem, we are given an array, and we are required to rotate the array by d elements using a reversal algorithm, for example −Input : arr[] = [1, 2, 3, 4, 5, 6, 7], d = 2 Output : arr[] = [3, 4, 5, 6, 7, 1, 2] Explanation : As you can see we have to rotate this array by d = 2 but our main task is to achieve this by using a reversal technique.We make some calculations for the rotation of the array by reversal technique, and we conclude that −First, we reverse the ...

Read More

Repeated Unit Divisibility using C++

Prateek Jangid
Prateek Jangid
Updated on 29-Nov-2021 271 Views

In this article, we will discuss finding the number of repeated units divisible by N. Repeated units are the repetitive numbers of 1 only, Let R(k) be the repetitive unit where k is the length of 1’s. E.g R(4) = 1111. So we need to find the minimum number of k for which R(k) is divisible by N, for example −Input : N = 13 Output : k = 6 Explanation : R(6) i.e 111111 is divisible by 13. Input : N = 31 Output : k = 15Approach to find The SolutionYou can approach this problem by checking ...

Read More

Removing Elements Between the Two Zeros using C++

Prateek Jangid
Prateek Jangid
Updated on 29-Nov-2021 206 Views

In this article, we will discuss how to remove elements between two zeros from a given string that contains only zero’s and one’s character. The final string should not contain any character ‘1’ surrounded by 0’s. For example −Input : string = “110010” Output : “11000” Explanation: 1 is found between two zeros at the 4th index. Input : string = “0010” Output : “000” Explanation : 1 is found between two zeros at the 2nd index.Approach to find The SolutionWe can apply a simple approach, i.e., traverse the string using a loop and check the previous and next ...

Read More

Remove repeated digits in a given number using C++

Prateek Jangid
Prateek Jangid
Updated on 29-Nov-2021 647 Views

In this article, we are given a number n, and we need to remove repeated digits in a given number.Input: x = 12224 Output: 124 Input: x = 124422 Output: 1242 Input: x = 11332 Output: 132In the given problem, we will go through all the digits and remove the repeating digits.Approach to find The SolutionIn the given approach, we will go through all the digits of n from right to left now. We go through digits of n by taking mod of n with 10 and then dividing n with 10. Now our current digit is n ...

Read More
Showing 46851–46860 of 61,297 articles
Advertisements