Prabhdeep Singh has Published 197 Articles

JavaScript Program to Check if it is possible to make array increasing or decreasing by rotating the array

Prabhdeep Singh

Prabhdeep Singh

Updated on 13-Apr-2023 15:27:24

69 Views

Rotation of the array means to assume the array as a circular array and rotate the elements of the array to either their left or right direction by one index at each rotation and the element at one end may take the value present at another end. An Increasing array ... Read More

JavaScript Program to Check if all rows of a matrix are circular rotations of each other

Prabhdeep Singh

Prabhdeep Singh

Updated on 13-Apr-2023 15:26:25

108 Views

Matrix is a kind of 2-D array in which there is an array of fixed arrays that defines the rows and for each index of this array there are fixed length arrays present and the length of these arrays defines the number of columns present in the matrix. We can ... Read More

JavaScript Program to Check if all array elements can be converted to pronic numbers by rotating digits

Prabhdeep Singh

Prabhdeep Singh

Updated on 13-Apr-2023 15:25:20

49 Views

Pronic numbers are also known as rectangular numbers, the pronic numbers are numbers that are multiples of two consecutive numbers. We will be given an array of integers and we can rotate the digits in any direction for a certain number of times to get all combinations. For any combination ... Read More

JavaScript Program to Check if a string can be formed from another string by at most X circular clockwise shifts

Prabhdeep Singh

Prabhdeep Singh

Updated on 13-Apr-2023 15:24:08

82 Views

Circular clockwise shifts for the string mean rotating the characters of the string to their next character in alphabetic order. For each circular shift characters are converted to the next character and if there is no character present after the certain rotations (as ‘z’ is the last character of the ... Read More

JavaScript Program for Rotate Doubly linked list by N nodes

Prabhdeep Singh

Prabhdeep Singh

Updated on 13-Apr-2023 15:21:21

133 Views

A doubly linked list is a linear data structure where each node stores the address of the next and previous node. We have given a doubly linked list and we have to rotate the doubly linked list by N nodes and print it. Here N is the positive number and ... Read More

JavaScript Program to Check if a string can be obtained by rotating another string by 2 places

Prabhdeep Singh

Prabhdeep Singh

Updated on 13-Apr-2023 15:20:09

138 Views

We have given two strings s1 and s2 and we have to check if is it possible to obtain a string by rotating another string by 2 places. We can rotate the string either in an anti-clockwise or clockwise direction. Here we have to print ‘Yes’ if both the string ... Read More

JavaScript Program to Check if a string can be obtained by rotating another string d places

Prabhdeep Singh

Prabhdeep Singh

Updated on 13-Apr-2023 15:18:37

70 Views

Rotating a string means moving the characters of the string to their left or right side by one index and one end may contain the value stored at the other end. We will be given two strings and we have to rotate the second string either in the left or ... Read More

JavaScript Program for Rotate a Matrix by 180 degrees

Prabhdeep Singh

Prabhdeep Singh

Updated on 12-Apr-2023 12:25:24

192 Views

A square matrix is a kind of 2-D array with an equal number of rows and columns and we have to rotate the matrix by 180 degrees anticlockwise. Rotating a matrix anti-clockwise means first converting all the rows into columns and the first row will be the first column and ... Read More

JavaScript Program For Reversing Alternate K Nodes In A Singly Linked List

Prabhdeep Singh

Prabhdeep Singh

Updated on 12-Apr-2023 12:23:26

74 Views

Reversing a linked list means arranging all the nodes of the linked list in the opposite manner as they were present earlier or moving the elements present at the last of the linked list towards the head and head nodes towards the tail. Alternate K nodes reversing means reversing the ... Read More

JavaScript Program For Reversing A Linked List In Groups Of Given Size

Prabhdeep Singh

Prabhdeep Singh

Updated on 12-Apr-2023 12:22:20

122 Views

A linked list is a linear data structure that consists of interconnected nodes. Reversing a linked list means changing the order of all its elements. Reversing a linked list in groups of a given size means, we are given a number and we will reverse the first given number of ... Read More

Advertisements