Sunidhi Bansal has Published 1085 Articles

Print reverse of a Linked List without actually reversing in C language

Sunidhi Bansal

Sunidhi Bansal

Updated on 22-Aug-2019 08:48:12

340 Views

The task is to print the reverse of a given linked list by using recursive function. The program must print the reverse but not reverse the list that means the order of the nodes remains the sameHere, the program will move head pointer containing the address of a first node ... Read More

Print pair with maximum AND value in an array in C Program.

Sunidhi Bansal

Sunidhi Bansal

Updated on 22-Aug-2019 08:45:50

245 Views

According to the problem we are given an array of n positive integers, we have to find a pair with maximum AND value from the array.ExampleInput: arr[] = { 4, 8, 12, 16 } Output: pair = 8 12 The maximum and value= 8 Input:arr[] = { 4, 8, ... Read More

Print Right View of a Binary Tree in C language

Sunidhi Bansal

Sunidhi Bansal

Updated on 22-Aug-2019 08:45:40

393 Views

The task is to print the right nodes of a given binary tree. Firstly user will insert data for creating a binary tree and than print right view of the tree so formed.The above diagram showcase the binary tree created with the nodes 10, 42, 93, 14, 35, 96, 57 ... Read More

Print middle level of perfect binary tree without finding height in C language

Sunidhi Bansal

Sunidhi Bansal

Updated on 22-Aug-2019 08:43:00

234 Views

The program should print the middle level of a binary tree e.g. if there are 4 levels in a binary tree than the program must print the level 2 nodes but the demand here is to calculate the level without finding the height.Perfect binary tree is a tree in which ... Read More

Print the longest prefix of the given string which is also the suffix of the same string in C Program.

Sunidhi Bansal

Sunidhi Bansal

Updated on 22-Aug-2019 08:36:54

1K+ Views

Given a string in which we have to check that the length of the longest prefix which is also a suffix of the string like there is a string “abcab” so here “ab” is of length 2 and is the longest substring with same prefix and suffix.ExampleInput: str[] = { ... Read More

Print Leaf Nodes at a given Level in C language

Sunidhi Bansal

Sunidhi Bansal

Updated on 22-Aug-2019 08:35:39

991 Views

The task involves printing leaf nodes of a binary tree at given level k which is specified by the user.Leaf nodes are the end nodes whose left and right pointer is NULL which means that particular node is not a parent node.ExampleInput : 11 22 33 66 44 88 77 ... Read More

Print Left View of a Binary Tree in C language

Sunidhi Bansal

Sunidhi Bansal

Updated on 22-Aug-2019 08:33:00

603 Views

The task is to print the left nodes of a given binary tree. Firstly user will insert data hence generating binary tree and than print left view of the tree so formed.Every node can have at most 2 child so here the program must traverse only the left pointer associated ... Read More

Print modified array after multiple array range increment operations in C Program.

Sunidhi Bansal

Sunidhi Bansal

Updated on 22-Aug-2019 08:25:46

148 Views

Given an array arr[m] with m number of integers and n, which is the value to be added in an array and r queries are given with some start and end. For each query we have to add value n from the start till the end of the limit in ... Read More

Print lower triangular matrix pattern from given array in C Program.

Sunidhi Bansal

Sunidhi Bansal

Updated on 22-Aug-2019 08:19:21

2K+ Views

Given with the matrix of n x n the task is to print that matrix of n x n in lower triangular pattern.Lower triangular matrix is a matrix which has elements below the principle diagonal including the principle diagonal elements and rest elements as zero.Let’s understand this with help of ... Read More

Print the matrix diagonally downwards in C Program.

Sunidhi Bansal

Sunidhi Bansal

Updated on 22-Aug-2019 08:08:58

462 Views

Given with an array of size n x n and the task is to print the matrix elements of integer type diagonally downwards.Diagonally downwards means printing the array of any size of n x n in diagonally moving downward like in the figure given below −Firstly it will print 1 ... Read More

Advertisements