Question about Computers & Internet

1 Answer

Source code for implementation of linked list using opengl in vc++

Posted by on

  • aysha May 01, 2013

    plz give opengl source code for single linked list

×

1 Answer

  • Level 2:

    An expert who has achieved level 2 by getting 100 points

    MVP:

    An expert that gotĀ 5 achievements.

    Governor:

    An expert whose answer gotĀ voted for 20 times.

    Scholar:

    An expert who has written 20 answers of more than 400 characters.

  • Expert
  • 65 Answers

Source code:

#include
using namespace std;
class linklist
{
private:
struct node
{
int data;
node *link;
}*p;
public:
linklist();
void append( int num );
void add_as_first( int num );
void addafter( int c, int num );
void del( int num );
void display();
int count();
~linklist();
};
linklist::linklist()
{
p=NULL;
}
void linklist::append(int num)
{
node *q,*t;
if( p == NULL )
{
p = new node;
p->data = num;
p->link = NULL;
}
else
{
q = p;
while( q->link != NULL )
q = q->link;
t = new node;
t->data = num;
t->link = NULL;
q->link = t;
}
}
void linklist::add_as_first(int num)
{
node *q;
q = new node;
q->data = num;
q->link = p;
p = q;
}
void linklist::addafter( int c, int num)
{
node *q,*t;
int i;
for(i=0,q=p;i {
q = q->link;
if( q == NULL )
{
cout return;
}
}
t = new node;
t->data = num;
t->link = q->link;
q->link = t;
}
void linklist::del( int num )
{
node *q,*r;
q = p;
if( q->data == num )
{
p = q->link;
delete q;
return;
}
r = q;
while( q!=NULL )
{
if( q->data == num )
{
r->link = q->link;
delete q;
return;
}
r = q;
q = q->link;
}
cout}
void linklist::display()
{
node *q;
cout for( q = p ; q != NULL ; q = q->link )
coutdata;
}
int linklist::count()
{
node *q;
int c=0;
for( q=p ; q != NULL ; q = q->link )
c++;
return c;
}
linklist::~linklist()
{
node *q;
if( p == NULL )
return;
while( p != NULL )
{
q = p->link;
delete p;
p = q;
}
}
int main()
{
linklist ll;
cout ll.append(12);
ll.append(13);
ll.append(23);
ll.append(43);
ll.append(44);
ll.append(50);
ll.add_as_first(2);
ll.add_as_first(1);
ll.addafter(3,333);
ll.addafter(6,666);
ll.display();
cout ll.del(333);
ll.del(12);
ll.del(98);
cout return 0;
}

Posted on May 19, 2011

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya expert can help you resolve that issue over the phone in a minute or two.
best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
click here to download the app (for users in the US for now) and get all the help you need.
goodluck!

Posted on Jan 02, 2017

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

2 Answers

Restriction code


hi restriction codes is nothing but your mobile is locked to particular network.due to this it accepts only the particular Sim when ever other network Sim is inserted it shows Sim restricted .there are many ways to solve this problem we can use software,cable ,codes etc....among them codes are the best .to get the codes you can visit here theunlockarena
Here they ask the following details before rendering theunlock codes they are 1. Mobile model 2. Country from where you brought the mobile 3. Provider to which the mobile is locked 4. Imei number of the mobile Finally they will send you the unlock codes .once youentered the code in your mobile as for the instruction given by them .yourmobile get unlocked and it accepts any network sim.

Jul 10, 2011 | Nokia 7370 Cellular Phone

1 Answer

I want a paint brush application using opengl


Pain.net is one of the best open source paint programs. You can download at the link below:

http://www.getpaint.net/

Nov 14, 2009 | Advanced Graphics Programming Using OpenGL...

1 Answer

I want a program in openGL for the paint editor


i want a mini project on opengl the topic is graphics ediotor jst like ms paint

May 20, 2009 | Advanced Graphics Programming Using OpenGL...

1 Answer

Opengl code


OpenGL doesn't handle photonics or any other low-level physics - you'll either need a raytracer, such as POVRAY or Blender, or you'll have to write the physics yourself, to emulate light rays of varying colours (I recommend using a HSL colour space for your physics, only translating to RGB when rendering the frame).
The refraction of a ray at the interface of the prism and the "air" can be calculated using Index of Refraction, correction factor to account for different refraction dependent on frequency (Hue) and a random number generator to emulate slight scattering.

Apr 24, 2009 | Advanced Graphics Programming Using OpenGL...

1 Answer

Data mining


Hello, you can find the best open-source implementation of data-mining algorithms here:
http://www.cs.waikato.ac.nz/ml/weka/

You can use the built-in application or embed it in your own code.
Of course it implements several naive bayes algorithms

Mar 20, 2008 | Computers & Internet

Not finding what you are looking for?
Computers & Internet Logo

Related Topics:

270 people viewed this question

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts

Doctor PC
Doctor PC

Level 3 Expert

7733 Answers

kakima

Level 3 Expert

102366 Answers

David Payne
David Payne

Level 3 Expert

14161 Answers

Are you a Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...