Jump to content

How to create two sets using linear bitmap implementation of sets

- - - - -

  • Please log in to reply
2 replies to this topic

#1
coolgirl

coolgirl

    Newbie

  • Members
  • Pip
  • 4 posts
Here is the question:
Let there be 2 sets melee and strength
melee={faceless,magnataur,sandking,soulbreaker,ursa}
strength={sandking,axe,pandaren,beastmaster,soulbreaker}
Answer the following questions with your program:
1) Find strength union melee
2) Find strength intersect melee
3) Insert slark into melee
4) Check whether pandaren is strength
5) Is any member of {slayer, sandking, drow} a strength hero?

Hint:
Declare an array of strings called hero[11][10] and insert the following lines to
initialize it:
strcpy(hero[0], “faceless”);
strcpy(hero[1], “magnataur”);
strcpy(hero[2], “sandking”);
strcpy(hero[3], “soulbreaker”);
strcpy(hero[4], “ursa”);
strcpy(hero[5], “axe”);
strcpy(hero[6], “pandaren”);
strcpy(hero[7], “beastmaster”);
strcpy(hero[8], “slark”);
strcpy(hero[9], “slayer”);
strcpy(hero[10], “drow”);

Alternatively you may initialize it upon declaration.
Then follow the following map for the hero index to the bit position.
melee={faceless,magnataur,sandking,soulbreaker,ursa,slark}
strength={magnataur,sandking,soulbreaker,axe,pandaren,beastmaster}
melee={0,1,2,3,4,8}
strength={1,2,3,5,6,7}

Please help me to create or guide me to create simple C code using linear bitmap implementation...plzzzzzzzzzzzz

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
We really need a best guess to start from.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
coolgirl

coolgirl

    Newbie

  • Members
  • Pip
  • 4 posts
#include<stdio.h>
#include<stdlib.h>

void print(char s[]){

//Im not sure how to create this function definition n is the two data OR one data taken into function

}

int main()
{


return 0;
}


Please help me to create C-code as like above one using the information from question..N im not sure where to declare and initialize the array(is it in main function OR outside main function???)....Plzzzzzzzzzz




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users