Thursday, May 24, 2007

How do you reverse a linked list without using any C pointers?

One way is to reverse the data in the nodes without changing the pointers themselves. One can also create a new linked list which is the reverse of the original linked list. A simple C program can do that for you. Please note that you would still use the "next" pointer fields to traverse through the linked list (So in effect, you are using the pointers, but you are not changing them when reversing the linked list).

82 comments:

sindhu said...

"One way is to reverse the data in the nodes without changing the pointers themselves."

can u explain how to reverse the data in the nodes to get SLL reversed...

Vijayendra Prakash said...

Hey Sindhu, Its easy..

U can push the contents of the linked list to a stack and the pop to a new linked list.. :)

Anonymous said...

You can out the contents in array and read the array from last element...

Divya said...
This comment has been removed by the author.
Anonymous said...

I found this site using [url=http://google.com]google.com[/url] And i want to thank you for your work. You have done really very good site. Great work, great site! Thank you!

Sorry for offtopic

Anonymous said...

Who knows where to download XRumer 5.0 Palladium?
Help, please. All recommend this program to effectively advertise on the Internet, this is the best program!

Anonymous said...

[url=http://pdw2010.uoftpharmacy.com/bbpress/]Where Can I Purchase Viagra[/url]

bira said...

thank u !!!!U ppl did splendid work!!!!

RAMESH_UMAR said...

// here h is head of list....
void llist::revlist()
{
node *p,*q,*r;
p=h;
if(h==(node *)0)
cout<link;
p->link=NULL;
while(q!=(node*)0) {
r=q->link;
q->link=p;
p=q;
q=r;
}
h=p;
}
}

RAMESH_UMAR said...

// NTH NODE FROM LAST IS GIVEN AS ...
void llist::Nthnodefromlast(int n)
{
node *p,*q;
int c=0;
p=q=h;
if(h==NULL)
cout<<" llist is empty........"<link;
}
while(p!=NULL)
{
p=p->link;
q=q->link;
}
}
cout<data<<endl;
}

RAMESH_UMAR said...
This comment has been removed by the author.
Anonymous said...

Helo ! Forex - Работа на дому на компьютере чашкой чая успешно получать деньги, пройти регистрацию forex [url=http://foxfox.ifxworld.com/]forex[/url]

Anonymous said...

http://13dfgsdfg57.com/

Anonymous said...

generic xanax order xanax online mastercard - xanax side effects hiccups

Anonymous said...

xanax online no prescription xanax taper - how long does a xanax high last

Anonymous said...

buy tramadol online tramadol overdose how much is fatal - tramadol 50 mg

Anonymous said...

generic xanax xanax effects fetus - xanax drug test levels

Anonymous said...

generic xanax buying xanax online illegal - xanax effects on sperm count

Anonymous said...

buy carisoprodol take soma carisoprodol - carisoprodol 350 mg dosage

Anonymous said...

buy tramadol online tramadol 50 mg extended release - tramadol online sale

Anonymous said...

carisoprodol buy carisoprodol 350 mg ndc - carisoprodol 350 mg drug test

Anonymous said...

buy xanax 2mg green generic xanax bars - xanax bar juice

Anonymous said...

buy carisoprodol carisoprodol tablets usp 350 mg - carisoprodol how to abuse

Anonymous said...

xanax online xanax dosage long does last - xanax side effects in men

Anonymous said...

generic xanax xanax side effects pregnancy - generic xanax thailand

Anonymous said...

buy tramadol online tramadol 50 mg get high - what is ultram tramadol used for

Anonymous said...

buy tramadol online high with tramadol - tramadol hcl online

Anonymous said...

buy tramadol online buy tramadol online no prescription overnight - can you buy tramadol in greece

Anonymous said...

xanax online xanax drug name - what is xanax drug

Anonymous said...

buy xanax valium online florida usual dosage xanax - do drug test test xanax

Anonymous said...

xanax online xanax drug test detection time - generic xanax good

Anonymous said...

buy tramadol online buy tramadol in missouri - tramadol 50mg ratiopharm

Anonymous said...

xanax online does xanax show up urine drug test - xanax drug profile

Anonymous said...

buy tramadol online tramadol 50 mg 100 caps - order tramadol online no prescription overnight

Anonymous said...

buy carisoprodol carisoprodol 125mg - carisoprodol 350

Anonymous said...

buy carisoprodol carisoprodol buzz - carisoprodol 350 mg description

Anonymous said...

cialis online price of cialis at boots - buy cialis 20mg

Anonymous said...

buy xanax online cod xanax for anxiety attacks - xanax overdose vomiting

Anonymous said...

buy cialis online cialis reviews by women - cialis 20 online

Anonymous said...

cialis online price for cialis daily use - cialis 5 mg

Anonymous said...

buy cialis online cheap cialis 40 mg - generic cialis purchase

Anonymous said...

buy cialis daily cialis daily medication - order cialis over the counter

Anonymous said...

cialis online 36 hour cialis reviews - buy cialis at walmart

Anonymous said...

xanax online xanax generic side effects - drug information on xanax

Anonymous said...

can you buy cialis over the counter cialis soft - buy cialis daily use

Anonymous said...

http://buytramadolonlinecool.com/#96430 tramadol withdrawal in babies - tramadol for dogs overdose

Anonymous said...

cheap tramadol online tramadol addiction and withdrawal - buy-cheap-tramadol.org

Anonymous said...

buy tramadol online tramadol for dogs 50 mg - tramadol 50 mg normal dosage

Anonymous said...

http://blog.dawn.com/dblog/buy/#91875 mexican tramadol 100mg - metacam and tramadol for dogs

Anonymous said...

buy tramadol in florida tramadol for dogs uti - can you buy tramadol dominican republic

Anonymous said...

buy tramadol tramadol for dogs price - buy tramadol online safe

Anonymous said...

buy tramadol tramadol hcl 50 mg snort - tramadol overdose 200mg

Anonymous said...

http://blog.dawn.com/dblog/buy/#fda tramadol 100 mg m/r - tramadol 50 mg narcotic

Anonymous said...

learn how to buy tramdadol tramadol ultram controlled substance - tramadol hcl 50 mg po tab

Anonymous said...

buy tramadol tramadol restless legs - buy tramadol online visa

Anonymous said...

http://buytramadolonlinecool.com/#30807 maximum dosage tramadol 24 hours - купить tramadol online

Anonymous said...

learn how to buy tramdadol tramadol hcl painkiller - tramadol 50 mg for humans

Anonymous said...

http://reidmoody.com/#51208 ativan bipolar - long does ativan high last

Anonymous said...

ways to buy ativan online lorazepam bp 1mg - zopiclone ativan side effects

Anonymous said...

Cheap Chanel Handbags 715496 Hermes online 147350 Louis Vuitton Handbags 279788 http://hermesbirkinsale.cabanova.com/

Anonymous said...

buy ativan online ativan dosage mri - ativan withdrawal and night sweats

Anonymous said...

buy xanax online forum 3mg xanax withdrawal - xanax high forum

Anonymous said...

christian louboutin outlet store 121908 christian louboutin outlet 435093 Louis Vuitton Handbags outlet 208779 http://cheapburberrybagsoutlet.cabanova.com/

Anonymous said...

Louis Vuitton Handbags outlet 730436 christian louboutin outlet online 444116 cheap christian louboutin 970652 http://cheaplouboutinshoes.cabanova.com/

Anonymous said...

buy xanax online buy xanax online without rx - xanax high side effects

Anonymous said...

buy tramadol online tramadol high - can you buy tramadol usa

Anonymous said...

Hermes Bags on sale 909220 Louis Vuitton Bags 829437 Chanel Outlet 127723 http://louisvuittonoutletstores.cabanova.com/

Anonymous said...

Louis Vuitton Outlet 227266 christian louboutin outlet 790761 discount christian louboutin 369051 http://hermesbagsoutletsale.cabanova.com/

Anonymous said...

buy tramadol in florida ultram side effects in women - can you withdrawal tramadol

Anonymous said...

Burberry Bags online 516012 Gucci Outlet 540911 Burberry Bags online 633129 http://hermesbirkinsale.cabanova.com/

Anonymous said...

Hermes Outlet 773040 Hermes Bags 656221 Hermes online 792156 http://discountlouisvuittonbags.cabanova.com/

Anonymous said...

buy tramadol online order tramadol pharmacy - tramadol for dogs cough

Anonymous said...

buy xanax online percocet xanax drug interactions - xanax 0.5 side effects

Anonymous said...

buy xanax online home remedies xanax overdose - xanax side effects while pregnant

Anonymous said...

buy xanax online is generic xanax as strong - what color is generic xanax

Anonymous said...

buy xanax online xanax overdose happens - cheap legal xanax

Anonymous said...

I loved as much as you will receive carried out right here.
The sketch is attractive, your authored material stylish.

nonetheless, you command get got an impatience over
that you wish be delivering the following. unwell unquestionably come more
formerly again as exactly the same nearly a
lot often inside case you shield this hike.

Feel free to surf to my web page ... tao of badass

Anonymous said...

buy tramadol usa buy tramadol cheap - purchase tramadol

Anonymous said...

Remarkable things here. I am very satisfied to peer your post.
Thank you so much and I am taking a look forward to contact
you. Will you kindly drop me a e-mail?

Here is my web page website

Ramesh rama said...
This comment has been removed by the author.
Anonymous said...

Free ladyboys
http://tranny.net.erolove.in/?page-kenzie
ebony shemaled free transexual fuck videos ebony tgirl movies sex videos shemals ladyboys

Aadit said...





Thank you for your feedback. We're glad you enjoyed the post. Feel free to share it with others you think may benefit from this information.


SensualKart Viagra in India