Re: [algogeeks] Questions on Hashing ...Share ur ideas...

2011-10-26 Thread Siddharth kumar
Solution for Problem 4: #includeiostream #define size 10 //size = sizeof(arr); #define max 8 //max = maxof(arr[])+1; using namespace std; int main() { int arr[] = {2,4,6,4,6,3,5,1,5,7}, hasharr[max] = {0}, i, sum=8; for(i=0; isize; i++) hasharr[arr[i]] = 1;

[algogeeks] Questions on Hashing ...Share ur ideas...

2011-10-25 Thread kumar raja
Problem 1: Remove duplicate elements from an unsorted array of size N Problem 2: Find intersection of K unsorted array of N elements each. Intersection consists of elements that appear in all the K arrays. Problem 3: How to make a linked list support operations in O(1) time. The operations on

Re: [algogeeks] Questions on Hashing ...Share ur ideas...

2011-10-25 Thread praveen raj
problem 4.. good question... With regards, Praveen Raj DCE-IT 3rd yr 735993 praveen0...@gmail.com On Tue, Oct 25, 2011 at 5:57 PM, kumar raja rajkumar.cs...@gmail.comwrote: Problem 1: Remove duplicate elements from an unsorted array of size N Problem 2: Find intersection of K unsorted

Re: [algogeeks] Questions on Hashing ...Share ur ideas...

2011-10-25 Thread SAMM
First of Happy Diwali 2 all. For question number 4, this can be done by using a chained hashing technique along with a valid/invalid bit which wil say it has been processed or not.. After insertion has been done in the hash table. For finding the unique pairs .. Iterate over the elements

Re: [algogeeks] Questions on Hashing ...Share ur ideas...

2011-10-25 Thread SAMM
On 10/26/11, SAMM somnath.nit...@gmail.com wrote: First of Happy Diwali 2 all. For question number 4, this can be done by using a chained hashing technique along with a valid/invalid bit which wil say it has been processed or not.. After insertion has been done in the hash table. For