Tutorials

What are B-Trees?

B-tree is another very popular search tree. The node in a binary tree like AVL tree contains only one record. AVL tree is commonly stored in primary memory. In database application, where huge volume of data is handled, the search tree cannot be accommodated in primary memory. B-trees are primarily meant for secondary storage. A …

What are B-Trees? Read More »

What is Josephus Problem?

This is an interesting programming problem know in the literature as Josephus problem. The problem is given as: 1. Suppose there are n children standing in a queue. 2. Students are numbered from 1 to n in the clockwise direction. 3. Students choose a lucky number say m. They start counting in clockwise direction from …

What is Josephus Problem? Read More »

How to Swap Two Numbers Without Using Temporary Variable or Arithmetic Operators?

You have done swapping of two numbers using temporary variable or by using arithmetic operators. It can be done in following way. Lets take two numbers a=5 and b=7. Using Temporary Variable temp=a;            //temp becomes 5 a=b;                 //a becomes 7 b=temp;            //b becomes 5 Also Read: C++ program to swap two numbers using pointers Also Read: C++ …

How to Swap Two Numbers Without Using Temporary Variable or Arithmetic Operators? Read More »