Friday, October 15, 2010

CrazyEngineers Forum - Computer Science & IT Engineering

CrazyEngineers Forum - Computer Science & IT Engineering


Difference between Generalization and Inheritance

Posted: 14 Oct 2010 07:38 PM PDT

I have a subject called "Object Oriented Methodologies".
In this, I frequently come across these two terms: Generalization and Inheritance.

But, the difference between the 2 is not clearly mentioned anywhere.

Can anybody solve this query?
Please provide an example for the same.

best challenge for ceans

Posted: 14 Oct 2010 07:08 PM PDT

brothers how to solve these problems
Code:

http://projecteuler.net/index.php?section=problems&page=1
because the range is wide .Is there anyway to solve these things
I am able to solve two problems the first one and
and
Find the sum of digits in 100!
that too with the help of javascript .Because of javascript supports upto 170!
But how to solve other problems .How to solve this range problem


for more
my blog:Virtual Helper

Linked List

Posted: 14 Oct 2010 10:20 AM PDT

Hi CEans,
There is my coding in C for insertion of a new node at desired location(using call by reference method). During compilation the program succeed, but its not showing any output. If you have any idea please correct me.
#include<stdio.h>
#include<conio.h>
struct student
{
int data;
struct student *next;
};
void insert_pos(struct student **);
void main()
{
struct student *head;
head=create();
traverse(head);
insert_pos(&head);
traverse(head);
getch();
}
void insert_pos(struct student **head)
{
struct student *ptr, *loc=NULL,*n;
ptr=*head;
n=(struct student *)malloc(sizeof(struct student *));
printf("Enter value");
scanf("&#37;d",&n->data);
n->next=NULL
printf("Enter value where u want to insert");
scanf("%d",&item);
while(ptr!=NULL)
{
if(item==ptr->data)
{
loc=ptr;
break;
}
ptr=ptr->next;
}
if(loc==NULL)
ptr=n;
else
{
n->next=ptr->next;
loc->next=n;
}
}
struct student *create()
{
struct student *head=NULL,*ptr;
char choice='y';
while(choice='='||choice=='Y')
{
if(head==NULL)
{
head=(struct student *)malloc(sizeof(struct student *));
ptr=head;
}
else
{
ptr->next=(struct student *)malloc(sizeof(struct student *));
ptr=ptr->next;
}
ptr->next=NULL;
printf("Enter ur data");
scanf("%d",&ptr->data);
printf("Do u want 2 create another node");
scanf("%c",&choice);
}
return(head);
}
void traverse(struct student *ptr)
{
while(ptr!NULL)
{
printf("%d",ptr->data);
ptr=ptr->next;
}
}

No comments:

Post a Comment