Given a number n, print following pattern without using any loop. Input: n = 16 Output: 16, 11, 6, 1, -4, 1, 6, 11, 16
Let us first put ‘priority inversion’ in the context of the Big Picture i.e. where does this come from.
Find the n’th term in Look-and-say (Or Count and Say) Sequence. The look-and-say sequence is the sequence of below integers: 1, 11, 21, 1211, 111221, 312211, 13112221, 1113213211, …
Given a number line from -infinity to +infinity. You start at 0 and can go either to the left or to the right. The condition is that in i’th move, you take i steps.
Given two dates, find total number of days between them. The count of days must be calculated in O(1) time and O(1) auxiliary space.
There are n bikes and each can cover 100 km when fully fueled. What is the maximum amount of distance you can go using n bikes?
We have covered basic information about shared libraries in the previous post. In the current article we will learn how to create shared libraries on Linux.
This article is not for those algo geeks. If you are interested in systems related stuff, just read on…
When a C program is compiled, the compiler generates object code. After generating the object code, the compiler also invokes linker. One of the main tasks for linker is to make code of library functions (eg printf(), scanf(), sqrt(), ..etc) available to your program.
Given n sets of integers of different sizes. Each set may contain duplicates also. How to find the intersection of all the sets. If an element is present multiple times in all the sets, it should be added that many times in the result.
Question 1 Predict the output of the following program. What does the following fun() do in general?