Entries Tagged as 'Algorithms'
Linux Journal has an article in the January 2005 issue that introduces a doubly linked list that is designed for memory efficiency.
Typically elements in doubly linked list implementations consist of a pointer to the data, a pointer to the next node and a pointer to the previous node in the list.
The more memory efficient implementation […]
Bookmark it!
These icons link to social bookmarking sites where readers can share and discover new web pages.
[Read more →]
Tags:
Solve it without division operator and in O(n).
Bookmark it!
These icons link to social bookmarking sites where readers can share and discover new web pages.
Bookmark it!
These icons link to social bookmarking sites where readers can share and discover new web pages.
[Read more →]
Tags:interview quetsion·placements paper
Extension to this questions is - if there are some billion numbers are there, and you have enough memory to fit all these numbers. What is the best of to do the same?
Bookmark it!
These icons link to social bookmarking sites where readers can share and discover new web pages.
Bookmark it!
These icons link to social bookmarking sites where readers can share and discover new web pages.
[Read more →]
Tags:interview question·placements paper
This is related to google print application. In other words, we have many books out of which some books titles were different but content same. We need to figure out such cases efficiently. How?
Bookmark it!
These icons link to social bookmarking sites where readers can share and discover new web pages.
Bookmark it!
These icons link to social bookmarking sites where readers can share and discover new web pages.
[Read more →]
Tags:interview question·placements paper
For example, 5! = 1.2.3.4.5= 120 has one zero and 10! = 1.2.3.4.5.6.7.8.9.10 = 3628800 and has two zeros.
can anybody help? best of all answers comes here …
Bookmark it!
These icons link to social bookmarking sites where readers can share and discover new web pages.
Bookmark it!
These icons link to social bookmarking sites where readers can share and discover new web pages.
[Read more →]
Tags:Google·placements paper
The power set in Algebra theory is the set of all subsets of a set
(no..bull-set!) If a set has N elements then the power set will have
2^N elements. So if a set is denoted by {a,b} with a,b as elements then
the power set is { {},{a},{b},{a,b} }.The {} is the empty set.
Can anybody help? best […]
Bookmark it!
These icons link to social bookmarking sites where readers can share and discover new web pages.
[Read more →]
Tags:algorithm·Google·placements question·power set
The Typical one is - to find the files with some pattern recursively in a given directory.
$ find path/to/dir -name “*.html”
You can replace the “*.html” to your own filename pattern.
Another one is, in addition to above I need the text lines inside those files starting with letter t.
$ find path/to/dir -name “*.html” -exec grep “^t” […]
Bookmark it!
These icons link to social bookmarking sites where readers can share and discover new web pages.
[Read more →]
Tags:find·grep·recursive·unix command
The source code for bubble sort.
#include
#define NUM 6
void swap(int arr[], int i, int j) {
int tmp = arr[i];
arr[i] = arr[j];
arr[j] = tmp;
}
main() {
int arr[NUM],i,j;
// start reading nums
for(i=0;i
Bookmark it!
These icons link to social bookmarking sites where readers can share and discover new web pages.
[Read more →]
Tags:
Source code for shell sort is provided below.
#include
#define NUM 6
main() {
int arr[NUM],i,j, incr=2;
// start reading nums
for(i=0;i
Bookmark it!
These icons link to social bookmarking sites where readers can share and discover new web pages.
[Read more →]
Tags:
Source code for Insertion sort in C language.
#include
#define NUM 6
main() {
int arr[NUM],i,j;
// start reading nums
for(i=0;i
Bookmark it!
These icons link to social bookmarking sites where readers can share and discover new web pages.
[Read more →]
Tags: