Given an array of n elements, write an algorithm to rotate it right by k element without using any other array. In other words rotate an array in place. you can have temp variable to swap two elements. Ex:- Initial Array: A = {1, 2, 3, 4, 5, 6, 7, … [Continue reading]
Reverse a link list without using another

How to reverse a link list without using another link list? Note: Linked list is singly linked list (there is only next pointer no previous pointer). … [Continue reading]
Detect if there is a cycle in a linked list
How can you find if a given linked list has a cycle in it? Note: Linked list is singly linked list (there is only next pointer no previous pointer). … [Continue reading]
Find nth element from end of linked list
How to find nth element from the end of the linked list? Or in other words Given an integer ‘n’, return a pointer to the n-th node from the end of the list. Note: Linked list is singly linked list (there is only next pointer no previous pointer). … [Continue reading]
Find middle element of linked list
How to Find the middle element of a linked list without traversing twice ? Linked list is singly linked list(there is only next pointer no previous pointer). … [Continue reading]
Divide a triangle into n triangles

How to divide a triangle into n equal area triangles ? … [Continue reading]
Swap two integer variables
How to swap two integer variables without using the third variable ? … [Continue reading]
How to measure 4 gallon of water
How to measure exactly 4 gallon of water from 3 gallon and 5 gallon jars, Given, you have unlimited water supply from a running tap. It was also solved by Bruce Willis in one of his Die Hard movie to stop a bomb. … [Continue reading]
Four How many squares are there

1.) 2.) How many squares are in this picture ? … [Continue reading]
Objective Questions set C/C++ – Part 5
4 Objective type interview questions on C/C++ with answers Before you start:- You can check your answer by filling a,b,c,d or e in the text box. You can get the answer by clicking Give Up Button. Try yourself before giving up … [Continue reading]
- « Previous Page
- 1
- …
- 103
- 104
- 105
- 106
- 107
- …
- 116
- Next Page »