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
How to create two sets using linear bitmap implementation of sets
Started by coolgirl, Apr 26 2010 08:36 AM
2 replies to this topic
#1
Posted 26 April 2010 - 08:36 AM
|
|
|
#2
Posted 26 April 2010 - 03:37 PM
We really need a best guess to start from.
#3
Posted 27 April 2010 - 07:04 AM
#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
#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


Sign In
Create Account

Back to top









