Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Help me choose appropriate data structure

Reply
Thread Tools

Help me choose appropriate data structure

 
 
Kenny McCormack
Guest
Posts: n/a
 
      06-01-2010
In article <(E-Mail Removed)>,
Tom St Denis <(E-Mail Removed)> wrote:
....
>Let me ask you something, what service do you suppose you're providing
>if you do peoples homework and they don't ever learn anything?


Well, that's a very loaded question, but I will ignore most of its
underlying meaning for the moment. By the way, do you still beat your
wife??? (I'm here all week, tell your friends, try the veal...)

Anyway, the point is that the regs mentality, like the C standard, makes
perfect sense when viewed through the lens of the groupthink in this
newsgroup. But, when you remove that groupthink, you see at an instant
how absurd it all is. So, I won't bother trying to convince you -
because I give you credit that if you simply step back and view it like
a normal person (not a CLC reg) would, you'll see it very clearly. But
if you can't (or won't), then nothing I can say will change your view.

But consider this one point: If we assume that all of life is a learning
process - a view popular in the the CLC groupthink - that is, that
learning begins the day we are born (some say the most important
learning of our lives is ages 0-3), continues through the formal
schooling period (kindergarten, grade school, high school, college, grad
school, post grad), onto our first job, our second job and so on until
we die, then what is the difference between helping someone with a
problem they face in formal schooling vs. helping them with a problem
they face on the job? Aren't both forms of help helping them unfairly
vs. their peers?

--
Just for a change of pace, this sig is *not* an obscure reference to
comp.lang.c...

 
Reply With Quote
 
 
 
 
Tom St Denis
Guest
Posts: n/a
 
      06-01-2010
On Jun 1, 12:26*pm, (E-Mail Removed) (Kenny McCormack)
wrote:
> Well, that's a very loaded question, but I will ignore most of its
> underlying meaning for the moment. *By the way, do you still beat your
> wife??? (I'm here all week, tell your friends, try the veal...)


It's not loaded. I'm asking you what's the value in doing other
peoples homework. You're maintaining a line that the "regs" [of which
you are one btw] are somehow doing these people a disservice by
sniffing out homework questions and calling the posters on it. I want
to know what disservice that is.

> Anyway, the point is that the regs mentality, like the C standard, makes
> perfect sense when viewed through the lens of the groupthink in this


I have never met ANYONE from clc. There is no "groupthink" here other
than those of us with half a clue realize there is merit in people
learning their craft [e.g. so they're not **** developers who then
doom humanity].

> But consider this one point: If we assume that all of life is a learning
> process - a view popular in the the CLC groupthink - that is, that
> learning begins the day we are born (some say the most important
> learning of our lives is ages 0-3), continues through the formal
> schooling period (kindergarten, grade school, high school, college, grad
> school, post grad), onto our first job, our second job and so on until
> we die, then what is the difference between helping someone with a
> problem they face in formal schooling vs. helping them with a problem
> they face on the job? *Aren't both forms of help helping them unfairly
> vs. their peers?


Well you are right that the learning never stops. But I would not
accept lame "Please discuss the merits of globals versus local
variables" style questions from someone out of school either.

The constructive people here asks questions like "here's a snippet of
code, can anyone help me find the problem with it?" whereas people
like the OP [and other people who ask "homework" questions] don't do
any of the initial legwork themselves. They just want the answer and
not the learning experience from it.

What's so wrong with taking a bit of personal responsibility.
Presumably you're asking questions in clc because you need/want to
learn C. So why not LEARN C as opposed to going through the motions
to pass an exam and then be yet another useless person with a degree?
 
Reply With Quote
 
 
 
 
Malcolm McLean
Guest
Posts: n/a
 
      06-01-2010
On Jun 1, 7:26*pm, (E-Mail Removed) (Kenny McCormack) wrote:
> what is the difference between helping someone with a
> problem they face in formal schooling vs. helping them with a problem
> they face on the job? *Aren't both forms of help helping them unfairly
> vs. their peers?
>

The schooling problem is an artifical one. It has been created by the
teacher so that the pupil, required to solve it, will in the process
learn about C. A work problem is nt artifical. It has arisen because
of the task at hand. Whilst the novice progammer may learn more by
solving the problem himself, it hasn't been specially designed so that
that will happen.

Of course students are always wanting certification rather than
education. It's a huge drawback to our current system. But solving
that one is far beyond the remit of a C programming newsgroup.


 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      06-01-2010
Malcolm McLean <(E-Mail Removed)> writes:
> On Jun 1, 6:56*pm, Tom St Denis <(E-Mail Removed)> wrote:
>> Let me ask you something, what service do you suppose you're providing
>> if you do peoples homework and they don't ever learn anything?
>>

> There's a difference, admittedly sometimes a fine one, between doing
> the homework and telling them how to do it.


Which is why it's good to know whether a given question is homework
or not; it can strongly affect the nature of the answer. I still
try to provide some background along with the answer, but if it's
homework I'll try harder not to answer directly.

--
Keith Thompson (The_Other_Keith) http://www.velocityreviews.com/forums/(E-Mail Removed) <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
Kenny McCormack
Guest
Posts: n/a
 
      06-01-2010
In article <(E-Mail Removed)>,
Keith Thompson <(E-Mail Removed)> wrote:
>Malcolm McLean <(E-Mail Removed)> writes:
>> On Jun 1, 6:56*pm, Tom St Denis <(E-Mail Removed)> wrote:
>>> Let me ask you something, what service do you suppose you're providing
>>> if you do peoples homework and they don't ever learn anything?
>>>

>> There's a difference, admittedly sometimes a fine one, between doing
>> the homework and telling them how to do it.

>
>Which is why it's good to know whether a given question is homework
>or not; it can strongly affect the nature of the answer. I still
>try to provide some background along with the answer, but if it's
>homework I'll try harder not to answer directly.


Please explain why there is a qualitative difference between helping
someone "cheat" on "homework" vs. getting ahead at work unfairly.

--
Just for a change of pace, this sig is *not* an obscure reference to
comp.lang.c...

 
Reply With Quote
 
Gene
Guest
Posts: n/a
 
      06-01-2010
On Jun 1, 3:32*pm, (E-Mail Removed) (Kenny McCormack) wrote:
> In article <(E-Mail Removed)>,
> Keith Thompson *<(E-Mail Removed)> wrote:
>
> >Malcolm McLean <(E-Mail Removed)> writes:
> >> On Jun 1, 6:56*pm, Tom St Denis <(E-Mail Removed)> wrote:
> >>> Let me ask you something, what service do you suppose you're providing
> >>> if you do peoples homework and they don't ever learn anything?

>
> >> There's a difference, admittedly sometimes a fine one, between doing
> >> the homework and telling them how to do it.

>
> >Which is why it's good to know whether a given question is homework
> >or not; it can strongly affect the nature of the answer. *I still
> >try to provide some background along with the answer, but if it's
> >homework I'll try harder not to answer directly.

>
> Please explain why there is a qualitative difference between helping
> someone "cheat" on "homework" vs. getting ahead at work unfairly.
>


I teach people for a living and have thought about this a lot. The
difference is the ethics of the social contract involved in learning
in the school setting. The student enters into the contract with the
object of learning. The teacher enters in order to help the student
learn.

The learning process requires assessment of student efforts for two
reasons: 1) to help the student by providing feedback on how he or she
is doing so appropriate adjustments of effort can occur and 2) to
record some kind of formal indicator (a grade or mark) useful for
others who need to know what the student knows. This is also part of
the social contract -- an information service provided by most
educational institutions through transcripts.

It's often the case - especially early in the learning process where
the concepts to be learned are simple for experienced people but hard
for the learner - that getting outside help hurts learning by -- in
addition to preventing some thought and other effort needed by the
studenty -- invalidating the whole assessment process.

If the student is paying his or her own way, you can make a great case
that 1) above is a non-issue. The student is shooting her or himself
in the foot. Who cares? Of course, if someone else is paying the bills
for the learning (if you are paying your kids' college tuition, for
example), then even 1) presents an ethical problem. If I'm paying
several thousand dollars (as I have done) for my kid to take a
beginning programming course at an Ivy League school, I don't want
USENET folks doing the homework problems so the teacher for whom I'm
paying good money is providing feedback on said USENET user's code
instead of my kid's.

The clearest problem however is with 2). Like or not, people can
obtain an unfair advantage in life by getting an unearned good grade.
In this sense, the outside help is obviously unethical.

The workplace is different because the objective isn't learning. Nor
do many workplaces provide information as a service regarding what
their employees know. Rather, work is about meeting the requirement
of the day. Unless the requirement is to solve a problem with no help
- maybe for IP reasons - getting help is part of the job. In fact, an
employee who can convince a USENET guru to solve an industrial problem
is someone I'd want on my team.

This is probably a personal blog about a philosophy for integrating
the Internet as part of education. Certainly our world, by the _end_
of a college education, we should be giving homework where getting
answers on USENET _is_ fine. The course I just taught to undergrad
seniors, for example, allowed _any_ reference information, including
the Internet, for all projects and the term end exam (all properly
documented, of course, and guidelines connecting level of help
received to grades were clear from the outset).

Unfortunately, though, there are educational tasks--gaining
fundamental concepts--that can't be completed unless communication
with others is circumscribed. The student has to get over those humps
in the road independently. A sports metaphor--that students seem to
get intuitively--is that one needs to learn to hit the ball in order
to play baseball or tennis. Until you get the basic skill on your
own, playing on teams is useless, and no fun, either.
 
Reply With Quote
 
yugeswar deenoo
Guest
Posts: n/a
 
      06-03-2010
On Jun 2, 2:02*am, Gene <(E-Mail Removed)> wrote:
> On Jun 1, 3:32*pm, (E-Mail Removed) (Kenny McCormack) wrote:
>
>
>
>
>
> > In article <(E-Mail Removed)>,
> > Keith Thompson *<(E-Mail Removed)> wrote:

>
> > >Malcolm McLean <(E-Mail Removed)> writes:
> > >> On Jun 1, 6:56*pm, Tom St Denis <(E-Mail Removed)> wrote:
> > >>> Let me ask you something, what service do you suppose you're providing
> > >>> if you do peoples homework and they don't ever learn anything?

>
> > >> There's a difference, admittedly sometimes a fine one, between doing
> > >> the homework and telling them how to do it.

>
> > >Which is why it's good to know whether a given question is homework
> > >or not; it can strongly affect the nature of the answer. *I still
> > >try to provide some background along with the answer, but if it's
> > >homework I'll try harder not to answer directly.

>
> > Please explain why there is a qualitative difference between helping
> > someone "cheat" on "homework" vs. getting ahead at work unfairly.

>
> I teach people for a living and have thought about this a lot. *The
> difference is the ethics of the social contract involved in learning
> in the school setting. The student enters into the contract with the
> object of learning. *The teacher enters in order to help the student
> learn.
>
> The learning process requires assessment of student efforts for two
> reasons: 1) to help the student by providing feedback on how he or she
> is doing so appropriate adjustments of effort can occur and 2) to
> record some kind of formal indicator (a grade or mark) useful for
> others who need to know what the student knows. *This is also part of
> the social contract -- an information service provided by most
> educational institutions through transcripts.
>
> It's often the case - especially early in the learning process where
> the concepts to be learned are simple for experienced people but hard
> for the learner - that getting outside help hurts learning by -- in
> addition to preventing some thought and other effort needed by the
> studenty -- invalidating the whole assessment process.
>
> If the student is paying his or her own way, you can make a great case
> that 1) above is a non-issue. The student is shooting her or himself
> in the foot. Who cares? Of course, if someone else is paying the bills
> for the learning (if you are paying your kids' college tuition, for
> example), then even 1) presents an ethical problem. If I'm paying
> several thousand dollars (as I have done) for my kid to take a
> beginning programming course at an Ivy League school, I don't want
> USENET folks doing the homework problems so the teacher for whom I'm
> paying good money is providing feedback on said USENET user's code
> instead of my kid's.
>
> The clearest problem however is with 2). *Like or not, people can
> obtain an unfair advantage in life by getting an unearned good grade.
> In this sense, the outside help is obviously unethical.
>
> The workplace is different because the objective isn't learning. Nor
> do many workplaces provide information as a service regarding what
> their employees know. *Rather, work is about meeting the requirement
> of the day. Unless the requirement is to solve a problem with no help
> - maybe for IP reasons - getting help is part of the job. *In fact, an
> employee who can convince a USENET guru to solve an industrial problem
> is someone I'd want on my team.
>
> This is probably a personal blog about a philosophy for integrating
> the Internet as part of education. Certainly our world, by the _end_
> of a college education, we should be giving homework where getting
> answers on USENET _is_ fine. *The course I just taught to undergrad
> seniors, for example, allowed _any_ reference information, including
> the Internet, for all projects and the term end exam (all properly
> documented, of course, and guidelines connecting level of help
> received to grades were clear from the outset).
>
> Unfortunately, though, there are educational tasks--gaining
> fundamental concepts--that can't be completed unless communication
> with others is circumscribed. *The student has to get over those humps
> in the road independently. *A sports metaphor--that students seem to
> get intuitively--is that one needs to learn to hit the ball in order
> to play baseball or tennis. *Until you get the basic skill on your
> own, playing on teams is useless, and no fun, either.


Thank you all for the replies so far.
This is definitely not my homework.
I just had a dilemma whether to implement in bitmaps or linked lists
(or arrays).
Now i tend to favor bitmaps over linked lists (or arrays)
I will try writing some code to implement in bitmaps and post it in
this forum, for your comments.
Once again thank you all !

 
Reply With Quote
 
bigbang
Guest
Posts: n/a
 
      06-03-2010
On Jun 3, 9:05*am, yugeswar deenoo <(E-Mail Removed)> wrote:
> On Jun 2, 2:02*am, Gene <(E-Mail Removed)> wrote:
>
>
>
>
>
> > On Jun 1, 3:32*pm, (E-Mail Removed) (Kenny McCormack) wrote:

>
> > > In article <(E-Mail Removed)>,
> > > Keith Thompson *<(E-Mail Removed)> wrote:

>
> > > >Malcolm McLean <(E-Mail Removed)> writes:
> > > >> On Jun 1, 6:56*pm, Tom St Denis <(E-Mail Removed)> wrote:
> > > >>> Let me ask you something, what service do you suppose you're providing
> > > >>> if you do peoples homework and they don't ever learn anything?

>
> > > >> There's a difference, admittedly sometimes a fine one, between doing
> > > >> the homework and telling them how to do it.

>
> > > >Which is why it's good to know whether a given question is homework
> > > >or not; it can strongly affect the nature of the answer. *I still
> > > >try to provide some background along with the answer, but if it's
> > > >homework I'll try harder not to answer directly.

>
> > > Please explain why there is a qualitative difference between helping
> > > someone "cheat" on "homework" vs. getting ahead at work unfairly.

>
> > I teach people for a living and have thought about this a lot. *The
> > difference is the ethics of the social contract involved in learning
> > in the school setting. The student enters into the contract with the
> > object of learning. *The teacher enters in order to help the student
> > learn.

>
> > The learning process requires assessment of student efforts for two
> > reasons: 1) to help the student by providing feedback on how he or she
> > is doing so appropriate adjustments of effort can occur and 2) to
> > record some kind of formal indicator (a grade or mark) useful for
> > others who need to know what the student knows. *This is also part of
> > the social contract -- an information service provided by most
> > educational institutions through transcripts.

>
> > It's often the case - especially early in the learning process where
> > the concepts to be learned are simple for experienced people but hard
> > for the learner - that getting outside help hurts learning by -- in
> > addition to preventing some thought and other effort needed by the
> > studenty -- invalidating the whole assessment process.

>
> > If the student is paying his or her own way, you can make a great case
> > that 1) above is a non-issue. The student is shooting her or himself
> > in the foot. Who cares? Of course, if someone else is paying the bills
> > for the learning (if you are paying your kids' college tuition, for
> > example), then even 1) presents an ethical problem. If I'm paying
> > several thousand dollars (as I have done) for my kid to take a
> > beginning programming course at an Ivy League school, I don't want
> > USENET folks doing the homework problems so the teacher for whom I'm
> > paying good money is providing feedback on said USENET user's code
> > instead of my kid's.

>
> > The clearest problem however is with 2). *Like or not, people can
> > obtain an unfair advantage in life by getting an unearned good grade.
> > In this sense, the outside help is obviously unethical.

>
> > The workplace is different because the objective isn't learning. Nor
> > do many workplaces provide information as a service regarding what
> > their employees know. *Rather, work is about meeting the requirement
> > of the day. Unless the requirement is to solve a problem with no help
> > - maybe for IP reasons - getting help is part of the job. *In fact, an
> > employee who can convince a USENET guru to solve an industrial problem
> > is someone I'd want on my team.

>
> > This is probably a personal blog about a philosophy for integrating
> > the Internet as part of education. Certainly our world, by the _end_
> > of a college education, we should be giving homework where getting
> > answers on USENET _is_ fine. *The course I just taught to undergrad
> > seniors, for example, allowed _any_ reference information, including
> > the Internet, for all projects and the term end exam (all properly
> > documented, of course, and guidelines connecting level of help
> > received to grades were clear from the outset).

>
> > Unfortunately, though, there are educational tasks--gaining
> > fundamental concepts--that can't be completed unless communication
> > with others is circumscribed. *The student has to get over those humps
> > in the road independently. *A sports metaphor--that students seem to
> > get intuitively--is that one needs to learn to hit the ball in order
> > to play baseball or tennis. *Until you get the basic skill on your
> > own, playing on teams is useless, and no fun, either.

>
> Thank you all for the replies so far.
> This is definitely not my homework.
> I just had a dilemma whether to implement in bitmaps or linked lists
> (or arrays).
> Now i tend to favor bitmaps over linked lists (or arrays)
> I will try writing some code to implement in bitmaps and post it in
> this forum, for your comments.
> Once again thank you all !


Hi, sorry, i was posting the above message from my friends laptop and
he had his google id signed in already.
 
Reply With Quote
 
bart.c
Guest
Posts: n/a
 
      06-03-2010
bigbang wrote:
> On Jun 3, 9:05 am, yugeswar deenoo <(E-Mail Removed)> wrote:


>> Thank you all for the replies so far.
>> This is definitely not my homework.
>> I just had a dilemma whether to implement in bitmaps or linked lists
>> (or arrays).
>> Now i tend to favor bitmaps over linked lists (or arrays)
>> I will try writing some code to implement in bitmaps and post it in
>> this forum, for your comments.


Don't forget bytemaps (unless that's what you meant by arrays). They take a
bit more memory, but have some advantages over bitmaps (less fiddly to
implement, and the ability to store other attributes per-card such as
colour).

--
Bartc

 
Reply With Quote
 
bigbang
Guest
Posts: n/a
 
      06-03-2010
#include<stdio.h>

#define MAX_CARD 503
#define MAX_CARD_BITMAP 64

typedef struct
{
unsigned char card_bitmap[MAX_CARD_BITMAP];
}LIST;

typedef struct _ABS_CARD_LIST
{
uint16 card;
_ABS_CARD_LIST *next;
}ABS_CARD_LIST;

typedef struct _CARD_RANGE
{
uint8 num_ranges;
uint16 *start;
uint16 *end;
}CARD_RANGE;


void init_cards(LIST *list)
{
int i;
for(i=0;i<MAX_CARD_BITMAP;i++)
{
list->card_bitmap[i] = 0;
}
}

void add_card(LIST *list, uint16 card)
{
if(card > MAX_CARD) { assert(0); }
list->card_bitmap[card>>3] |= 1<<(card&7);
}


void add_card_list(LIST *list, ABS_CARD_LIST *card)
{
ABS_CARD_LIST *temp = card;
while(temp)
{
add_card(temp->card);
temp = temp->next;
}
}

void add_card_range(LIST *list, CARD_RANGE *range)
{
int i;
uint16 j;
for(i=0;i<range->num_ranges;i++)
{
for(j=range->start[i];j<range->end[i];j++)
{
add_card(j);
}
}
}

This is my first draft version of code. The goal here is to add either
absolute list of card numbers (eq. 1,5,100,203) or numbers in range
(eg, 100-200, 300-400) to a final list of cards. This final list is
represented by bitmaps.
I'm just a beginner. So pardon me if i have done some mistakes.





 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple structure and copying data to pointer of the same structure A C++ 27 04-16-2011 11:07 PM
Help finding appropriate design pattern for event loggin Greg Dharma C++ 6 06-14-2009 05:03 PM
Most Appropriate Data Structure/Method Pat McDonnell Perl Misc 5 08-28-2007 07:13 PM
selecting and working with appropriate data type lane straatman C Programming 13 01-09-2007 06:55 PM
What structure to choose Vince C++ 1 05-25-2005 10:28 PM



Advertisments