Sunidhi Bansal has Published 1101 Articles

Print numbers in sequence using thread synchronization in C Program.

Sunidhi Bansal

Sunidhi Bansal

Updated on 22-Aug-2019 07:15:18

5K+ Views

Given with the threads the program must print the thread based on their priorities starting from 0 to 10.What is a thread?Thread is lightweight process that runs inside a program. A simple program can contain n number of threads.Unlike java, multithreading is not supported by the language standards, POSIX Threads ... Read More

Print leftmost and rightmost nodes of a Binary Tree in C Program.

Sunidhi Bansal

Sunidhi Bansal

Updated on 22-Aug-2019 07:11:00

936 Views

Given a binary tree with left and right children and the task is to print the exact right and left child of the given tree.Leftmost nodes are the nodes which are associated on the left side from the parent node of the tree and rightmost nodes are which are associated ... Read More

Print maximum sum square sub-matrix of given size in C Program.

Sunidhi Bansal

Sunidhi Bansal

Updated on 22-Aug-2019 07:04:58

458 Views

Given a matrix of NxN find a sub matrix of MxM where M=1 such that addition of all the elements of matrix MxM is maximum. Input of matrix NxN can contain zero, positive and negative integer values.ExampleInput:    {{1, 1, 1, 1, 1},    {2, 2, 2, 2, 2},   ... Read More

Print left rotation of array in O(n) time and O(1) space in C Program.

Sunidhi Bansal

Sunidhi Bansal

Updated on 22-Aug-2019 06:54:19

79 Views

We are given an array of some size n and multiple integer values, we need to rotate an array from a given index k.We want to rotate an array from a index k like −ExamplesInput: arr[] = {1, 2, 3, 4, 5}    K1 = 1    K2 = 3 ... Read More

Print k different sorted permutations of a given array in C Program.

Sunidhi Bansal

Sunidhi Bansal

Updated on 22-Aug-2019 06:49:37

136 Views

Given an array a[] containing N integers, the challenge is to print k different permutations of indices such that the values at those indices form a non-decreasing sequence. Print -1 if it is not possible.ExampleInput: arr[] = {2, 5, 6, 2, 2, 2, 2}, k = 4 Output:    0 ... Read More

Print index of columns sorted by count of zeroes in the Given Matrix in C Program.

Sunidhi Bansal

Sunidhi Bansal

Updated on 22-Aug-2019 06:38:22

83 Views

Given an array of size NxM where N number of rows and M number of columns, and the task is to print the number of zeroes in every column of a corresponding matrix after performing sort operation on the basis of number of zeros present in any column.For example if ... Read More

Print the corner elements and their sum in a 2-D matrix in C Program.

Sunidhi Bansal

Sunidhi Bansal

Updated on 22-Aug-2019 06:29:35

2K+ Views

Given an array of size 2X2 and the challenge is to print the sum of all the corner elements stored in an array.Assume a matrix mat[r][c], with some row “r” and column “c” starting row and column from 0, then its corner elements will be; mat[0][0], mat[0][c-1], mat[r-1][0], mat[r-1][c-1]. Now ... Read More

Print the balanced bracket expression using given brackets in C Program

Sunidhi Bansal

Sunidhi Bansal

Updated on 22-Aug-2019 06:24:14

214 Views

Given four variables a, b, c, d with predefined values that will print the given bracket depending upon the variable used.Where variable, a for (( b for () c for )( d for ))The task is to use all the given brackets and print the balanced bracket expression, if we ... Read More

Print the last occurrence of elements in array in relative order in C Program.

Sunidhi Bansal

Sunidhi Bansal

Updated on 22-Aug-2019 06:07:00

228 Views

Given an array a[] with elements and the task is to print the last occurrences of the given elements in the list. Here we not only have to remove the duplicate elements but also we have to maintain the order of the occurrences of the elements in an array as ... Read More

Print reverse of a Linked List without extra space and modification in C Program.

Sunidhi Bansal

Sunidhi Bansal

Updated on 22-Aug-2019 05:57:17

316 Views

The task is to print the nodes starting from the end of the linked list without using extra space which means there shouldn’t be any extra variable instead the head pointer pointing the first node will be moved.ExampleInput: 10 21 33 42 89 Output: 89 42 33 21 10There can ... Read More

Advertisements