- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Sunidhi Bansal has Published 1101 Articles
Sunidhi Bansal
146 Views
We have to print the k number of nodes of the linked list in reverse order. We have to apply the iterative approach to solve this problem.Iterative method is the one which generally uses loops that are executed till the condition holds value 1 or true.Let’s say, list contains the ... Read More
Sunidhi Bansal
2K+ Views
The task is to print the matrix of n x n of the diagonal pattern.If n is 3 then to print a matrix in Diagonal pattern is −So the output will be like −ExampleInput: 3 Output: 1 2 4 3 5 7 6 8 9 Input: 4 ... Read More
Sunidhi Bansal
94 Views
The task is to print the k nodes starting from the end of the linked list using recursive approach.Recursive approach is the one in which the function call itself again and again till the call is being made and hence stores the result.Let’s say, list contains the nodes 29, 34, ... Read More
Sunidhi Bansal
727 Views
In this problem, program must print the alternates from the given linked list that is leaving one printing other and so on using iterative method.Iterative method is the one which generally uses loops that are executed till the condition holds value 1 or true.Let’s say, list contains the nodes 29, ... Read More
Sunidhi Bansal
239 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
Sunidhi Bansal
137 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
Sunidhi Bansal
291 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
Sunidhi Bansal
131 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
Sunidhi Bansal
125 Views
Program should print the leaf nodes of a binary tree from left to right but the challenge involves is using of only one stackThrough push() function insert nodes of a binary tree and through pop() operation display the leaf nodes.Leaf nodes are the end nodes whose left and right pointer ... Read More
Sunidhi Bansal
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
To Continue Learning Please Login
Login with Google