iGuest
Members-
Content Count
72,093 -
Joined
-
Last visited
-
Days Won
5
Everything posted by iGuest
-
Data Structures -- Linked List -- Reverse Reverse a linked list
iGuest replied to varalu's topic in Programming
simple linked list Data Structures -- Linked List -- Reverse /* * Simple operations on linked list. If any problem * please mail to me jagannath_pattar@yahoo.Co.In */ #include <stdio.H> /* * Data structure used, its simple */ Typedef struct linked_list_s { int value; struct linked_list_s *next; }linked_list_t; /* * Add a node at the end of the list. */ Linked_list_t* add_node(linked_list_t *head, int value) { linked_list_t *newNode = NULL; linked_list_t *node = head; linked_list_t *prev = head; newNode = (linked_list_t *)calloc(1, sizeof(linked_list_t)); newNode->value = value; while(node) { prev = node; node = node->next; } if(prev == node) return newNode; prev->next = newNode; return head; } /* * delete a specified node from the list. */ Linked_list_t* delete_node(linked_list_t *head, int value) { linked_list_t *node = NULL; linked_list_t *prev = NULL; for(node = head; node != NULL; prev = node, node = node->next) { if(node->value == value) { //Check for head node modification if(prev == NULL) { head = head->next; free(node); return head; } prev->next = node->next; free(node); return head; } } return head; } /* * display all the nodes of the list. */ Void list_nodes(linked_list_t *head) { linked_list_t *node = head; printf("nHead"); while(node) { printf("->%d ",node->value); node = node->next; } printf("->NULLand"); } /* * Display all the nodes in reverse order withoout modifying list. */ Void list_nodes_in_reverse_order(linked_list_t *head) { linked_list_t *end = NULL; linked_list_t *node = NULL; printf("nReverse Head"); while(head != end) { node = head; while(node->next != end) node = node->next; printf("->%d ",node->value); end = node; } printf("->NULLand"); } /* * Reversing the linked list with recursion; I recommond this method.. */ Linked_list_t* reverse_with_recursion_anotherway(linked_list_t* current, linked_list_t* parent) { linked_list_t* revhead = NULL; if(current == NULL) revhead = parent; else { revhead = reverse_with_recursion_anotherway(current->next, current); current->next = parent; } return revhead; } /* * Reversing the linked list; */ Linked_list_t* reverse_with_recursion(linked_list_t* node) { linked_list_t* temp = NULL; if(node->next == NULL) return node; temp = reverse_with_recursion(node->next); temp->next =node; return node; } /* * reversing linked list without recursion. */ Linked_list_t* reverse_without_recursion(linked_list_t* head) { linked_list_t* prevNode = NULL; linked_list_t* currNode = head; linked_list_t* nextNode = head->next; while(currNode) { currNode->next = prevNode; prevNode = currNode; if(nextNode == NULL) break; currNode = nextNode; nextNode = nextNode->next; } return currNode; } /* * main program, which displays menu for maitaining linked list. */ Main() { int choice = -1; int value = 0; linked_list_t *head = NULL; linked_list_t *node = NULL; do { printf("and what you wanna do?and"); printf("1. Add a node and"); printf("2. Delete a node and"); printf("3. List all nodes and"); printf("4. Reverse (without recursion) the list and"); printf("5. Reverse (recursively) the list and"); printf("6. Reverse (recursively) another wayand"); printf("7. Just display in reverse orderand"); printf("8. Exit and"); scanf("%d",&choice); switch(choice) { case 1: printf("nEnter value: "); scanf("%d",&value); head = add_node(head, value); break; case 2: printf("nEnter value: "); scanf("%d",&value); head = delete_node(head, value); break; case 3: list_nodes(head); break; case 4: node = head; head = reverse_without_recursion(head); break; case 5: node = head; while(node->next) node = node->next; head = reverse_with_recursion(head); head->next = NULL; head = node; break; case 6: head = reverse_with_recursion_anotherway(head, NULL); break; case 7: list_nodes_in_reverse_order(head); break; case 8: exit(0); break; } }while(1); } -reply by jagannath -
How To Set Up A Dedicated Server Counter-Strike dedicated server setup
iGuest replied to DaEmOnFiRe's topic in Software
My cz dedicated server starts...But when I run cz and go to find servers in cz menu my server is not there in internet list...Then I directly put my server ip address in console...Then it diaplays lan servers are restricted to local clients only[class C]...(I start the server in internet only)...Plzzzzzz help I wnt to play cz wid my friends ...Please help me guys.-question by MeTaLSkuLL -
how do i Rpg Maker Xp How do I make it so in the game while I'm playing I can choose a name for my character please help me someone it is really anoying trying to figure it out! Reply Please -reply by Nebula
-
Restore Windows File And Folder Protection
iGuest replied to soleimanian's topic in Websites and Web Designing
How do you remove file and folder protection from files and folders Restore Windows File And Folder Protection While setting up a user account I was asked if I wanted to protect files and folders, so I clicke...Yes. Big mistake now I need to remove the protection. How is that done? -reply by Gerald Moore -
online/offline image via html I.p. Ping Online Or Offline I found a little know bit of html code that will do what I was wanting <img onerror="this.src='offline.gif/';" src="serveraddress.com/online.Gif;Will first try to load online.Gif from http://www.serveraddress.com/ Then IF online.Gif is NOT available, it will load offline.Gif From the same folder that the webpage is located (local in my case) No javascript, or PHP needed -reply by Th3Eagle
-
Dont wanna loose him Dealing With A Long Term Relationship Break Up I have been with my boyfrtiend for almost 3 years in feb. 2009. We went through a really bad rough time. Not because of him, but because of me. I cheated on him twice and had a few friends I associated with. He found ou t and things got ugly. I was stupid and shouldnt of did that to him. In my heart I really care and love him and right now it stills hurt him. I regret everything and he doesnt believe I can make things better. I really love my man and I beleive I can show him I changed. I want to continue on and stick by him. He doesnt trust me but he told me he stills loves me and its hard for him to break up with me since we have been together, but in a way he does want to break up. I don't know what to do. I can loose him.! what to do? we been through good and bad. And I apoloogize a trillion times for hurting him -reply by teyah
-
Exactly Why Are We Moving Away From The Sun? Replying to heavensounds This is exactly why planets keep their specific distance. If a planet has an eliptic path around the sun it will increase in current and therefor increase its magnetic field, therefor pulling away from the sun, decreasing its magnetic field.. Etc. This is why some asteroids are called comets, they have an eliptic path and increases its magnetic field so that we see a tail pointing away from the stronger magnet when it gets close. But gravity still works. Just as a magnet pulls metallic objects on both ends. Magnetic fields pull. And we are constrained by specific gravity. The same force that pulls water to drops, and form geodes in the ground. Condensation. But all planets are pulling away from eachother. And the universe is expanding. Why? Because the electromagnetic field increases, because matter is created in a strong magnetic field or in the presence of high energies. As Nikola Tesla stated: "Condensation of the primary substance is going on continuously, this being in a measure proved, for I have established by experiments which admit of no doubt that the sun and other celestial bodies steadily increase in mass and energy and ultimately must explode, reverting to the primary substance." This is what happens. All planets grow, and will keep growing into suns, red giants etc. Until they explode as supernovas, converting some of the matter into pr�me matter, and some into a plasma state called nebulas. Forget about the Big Bang. -reply by Linus Granstr�m
-
There is no right or wrong, this is merely a suggestion though. If you run out of cloak and an enemy sees you, you should do the following. (based on what you think.)1. Run behind a corner or find some form of cover*2. If it is a heavy or soldier, (slowest classes,) then you should try to disguise behind said corner*3. Just run away*4. Attempt to re-cloak*5. Fight to the death*6. Die* means "If you don't think this will work, try the suggestion below."-reply by Its me
-
Constant Crashes = Back to Firefox 2 Firefox 3 Sucks - Time For Another Browser I could care less about the interface changes, but when a program crashes one in every 3 times I use it or within the first 10 minutes of a usage session, I simply head for the UNINSTALL option and load up something that isn't a steaming pile of crap: namely, Firefox 2. I would hope that the Mozilla devs stop playing around with superficial interface "improvements" (although how the lack of a home button can qualify as an "improvement" is beyond me, but that's the subject of another post) and work on engine stability and core feature improvement. -reply by Iriverconvert
-
How To Set Up A Dedicated Server Counter-Strike dedicated server setup
iGuest replied to DaEmOnFiRe's topic in Software
It doesn How To Set Up A Dedicated Server Hi I'm new here, I followed the instrutions but my server is a 192.168.1.X.(IP) and not a online server ip like 85.XXX.XXX.XXX Can somebody help me? THANKS -reply by Rocky Tang -
HTML code to print web page Button To Print Current Web Page Replying to spacemonkey Dear Spacemonkey, Back in May of 2005, you responded to a question of what HTML code is necessary to print a web page that included "fill in form" features. I was impressed with how simple your coding was. You suggested: <input type="button" value="Print Page!" onclick="window.Print()" /> It works like a charm. I have another question for you now. Is there a simple code that sends the selected web page to someone when they click a "Submit" button. I need to know how to include an email address with that feature. Thanks in advance for any help you can offer. Tom T -question by Tom T
-
Money for TT Toontown Online Replying to LooneyMapleStory TT is a very good game, however, if I wanted to be frustrated looking for Keys (DG) I would be hiding my own. I left a job because of the constant frustration and hitting my head against the wall...Tt could prove to be as disaterous for younger kids.
-
networking vista and xp machines Sharing Files And Printer Between Windows Vista And Xp Replying to deepod I have the same problem. I networked my vista machine with my xp machine. I can see my xp machine and open files and print but I can not see my vista files. Were you able to resolve this problem and if so, how. Thanks, ron
-
.::gunz Online Clan::. making a gunz clan lvl 10+
iGuest replied to crimsoncross's topic in Computer Gaming
Can I join clan? .::gunz Online Clan::. Replying to crimsoncross Gunz name: Asbian Country: United States Plays a week: Every day Time(in GBA) play: Sorry, Don't know what that is. Level: 12 and growing. -reply by Tyler -
When the ticket monopolist is the worst scalper . . . . Cheated, Disappointed, And Nauseous I had a bad experience with Ticketmaster, which eventually turned out OK. I stayed up all night online to buy tix for Radiohead in Toronto from the pre-sale on the band's W.A.S.T.E. Site, but struck out. I then went into Ticketmaster the instant that sales opened there. Nothing. The scalpers got them all. I then bought two tix on eBay, very close to the stage, for $180 each. But when I complained (politely) to W.A.S.T.E. By email about my double strikeout, they sold me two tix down close, dead centre, for $79 each. So I resold the eBay tix for $200 each (adding $20 each to cover listing costs), and saw them resold there the same day for $250 each. I could also have sold the primo W.A.S.T.E. Tickets for up to $350 each the week before the show. Instead, we enjoyed a great concert at the original price, although I couldn't help wondering what the people around us had paid,and how many had been ripped off by Ticketmaster and its own scalping "service". -reply by Catchlight
-
It only works in Internet Explorer? Image Preloader With Progress Bar Status I used this script for my website, but it only works in the internet explorer... In any other browser it won't work - what could be the problem? I'm using "firebug" for firefox and there are no errors - but only in the ie it comes to the "OnCompletion()"-function. But the script & tutorial is very well work!! congratulations! -reply by daGizmo
-
I'm gonna say Myles Kennedy.Glad to see someone else thinks so too :)X-reply by Dral
-
Sharing "domain" & "workgroup" Network 2 dissimilar Computers?
iGuest replied to OneStopReefShop's topic in Computer Networks
access domain with workgroup computers Sharing "domain" & "workgroup" Hi How to access domain computers,using one work group system..Any settings... Are mentioned..Pls reply me. -question by vinay -
Calculator in javascript Php Calculator I just checkout the calculator posted here by someonein in javascript .. But the problem is that it is showng the opreator in the text field also. So can any one send the code of calculator which dnt shw the operator in the text field and havn only the single text field -question by tarundeep singh
-
Runescape: Good or Not ? Good or Not ?
iGuest replied to john_meikle1405241509's topic in Computer Gaming
Reply for your runescape question Runescape: Good or Not ? Tell mewhat is the name of the flash player. I don't expect that you could make any thing like that. The game is always updated and is now in the guiness book of word records. Your just one of those aragant idiots that can't apriciate what people put into things like this game -reply by link2william@aol.Com -
already decided Superpower India & China -arrival Of Bipolar World China is already a superpower by many measures, but China does not want to dominate the world like the old Soviet or the current US. A peaceful superpower is great for the world. India can certainly be a superpower as well, but it seems india has a lot of baggage, being colonized in the past has damaged the national pride. Some people insist that the western model is the only model for human society to succeed, China has proven it wrong. BTW, Bubai might have some fancy buildings now, but it will not last, it is a mirage in the desert, that part of the world need to sort out a lot of issues before they can be on the road to world powers. -reply by snowman121
-
Selling Used Games At Eb How much money do they give you?
iGuest replied to RockinTheCasbah's topic in Computer Gaming
I Want To Sell My Video Games, Can I And How Much Money Selling Used Games At Eb I'm thinking about selling some of my old games I never play anymore to EB, and I was just wondering, how much money would they give me? For example, if I sell a game that they sell for $10 on the used rack (and it's actually only on the used rack) how much money would they give me? -reply by Austin Stickle -
Ok my best friends girlfriend came over and hung out with him and she brought a friend and I came over to chill and I thought this girl was pretty so I talked to her and got to know her a little and then a couple days later they came over again, same thing happened except this time we flirted with each other a little more and her friend told me she liked me so later that night she called me and we talked for a couple hours for next couple days we talked and everything seemed fine and they come over again but this time my other friend was there to and we were chillin but of course my other friend starts acting like a d-bag and makes fun of people for attention well anyway a couple days past and the girls come back over and this time she acts kinda weird towards me like she's ignoring me and we were playing games and she starts acting kinda smart *bottom* and like she is ignoring everyone well I talked to her friend and she told me that she was just tierd of everyone trying to get with her and I just don't understand because I didn't really try to get with her I was just talking to her like a friend would but anyway I just want to know how to fix this and get back to being friends like we were but I don't know what to say or do so I need help with this one-reply by nick jones
-
What I do is go to al karid and kill the guards while wearing a ring of wealth. You will get herbs like Ranarr herbs which sell for 5-7k each. I get a full inventury which only takes 20mins for me then sell in Varrock. Also I fight steel or bronze dragons which are lvl 248 and 129. If you kill 50 steel dragons you get dragon platelegs. Also I fight abssal demons and if you kill lots of them in slayer tower you get abassal whips.Hoped I helpedRandom-reply by random
-
When it isn Firefox 3 Sucks - Time For Another Browser Oh... I'm a stupid moron who has to have the address line history put double spaced pictures because I'm too stupid to read. So then I have to scroll down forever to find what I'm looking for. When the downloader use to show a progress bar, now it doesn't. I have no idea if the file is loaded or how long it is going to take to load. Also with each update it takes longer and longer to startup. Now I can go take a nap and come back and it still hasn't loaded, and when it finally does, There are 20 to thirty pages running because the hour glass disappears so you keep clicking. Sell this company back to the original developer. He knows what he is doing. These people must have worked for Mac. -reply by Paul Schuster