GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Tech FAQs  >  OOPS
Go To First  |  Previous Question  |  Next Question 
 OOPS  |  Question 203 of 255    Print  
How can we delete a linklist without using start pointer
Pls specify the code

  
Total Answers and Comments: 2 Last Update: January 19, 2006     Asked by: harsha 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
January 03, 2006 21:18:08   #1  
Nitin Gupta        

RE: How can we delete a linklist without using start p...
Use a doubly linked list, then you can start from the current pointer and go back and forth and delete the nodes.
 
Is this answer useful? Yes | No
January 19, 2006 05:32:19   #2  
samiksc Member Since: October 2005   Contribution: 233    

RE: How can we delete a linklist without using start p...

In a circular singly linked list also it is possible to use the current pointer and delete all nodes. The pseudo code would be like this:

while (curr != null)

{

linkList *ptr = curr->next;

free(curr);

curr = ptr;

}


 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : All the solutions above are reading the source code with the files concepts.find a solution where you do not have a source file to read the contents.There is a macro or an attiribute which tells the compiler the name of the program, function or the attribute. ...

Latest Answer : Amit Banerjee Wrote: Delete this is not acceptable or possible since delete this means we are trying to delete the reference of the object and calling the function from the object itself.  Its like Kalidas , trying to cut the same branch on ...

Latest Answer : #include main(int argc, char *argv[]){  printf("Removing: %s...n", argv[0]);  remove(argv[0]);} ...

Latest Answer : Yes, Just Put it in an  unsigned int Bin_data[] {0x0h, 0x0f......... ............ } ...

Latest Answer : 7150u have to worry because this is a master program i had created when i started with c ...

Explain "passing by value", "passing by pointer" and "passing by reference"
Tags : Pointer

What will happen if I allocate memory using "new" and free it using "free" or allocate sing "calloc" and free it using "delete"?

Latest Answer : I am giving below another example of code optimization you can follow for C++ program. As we all know prefix operators apply the operations of incrementing or decrementing as specified and the new value is stored. In case of postfix operator the operations ...

Latest Answer : pointer : pointer is a derived data type which holds addresses as its value. it points to value at it's address.for ex:int *p;does not mean p type is integer. p can't be int. p is just a pointer variable. the above declaration means p is a pointer to ...
Tags : Pointer

Latest Answer : *(*(*(*(a+i)+j)+k)+l) ...
Tags : Pointer


 Sponsored Links

 
Related Articles

jQuery Table Row Finished Code

jQuery Table Row Finished Code The Finished Code Our second example page has demonstrated table row striping highlighting tooltips collapsing expanding and filtering Taken together the JavaScript code for this page is mosgoogle geshibot lang php" document ready function var highlighted
 

jQuery Interacting with Other Code

jQuery Interacting with Other Code We learned with our sorting and paging code that we can t treat the various features we write as islands The behaviors we build can interact in sometimes surprising ways; for this reason it is worth revisiting our earlier efforts to examine how they coexist with t
 

jQuery Completed sorting and paging code

Learning jQuery The Finished Code The completed sorting and paging code in its entirety follows mosgoogle geshibot lang php" fn alternateRowColors function tbody tr odd this removeClass even addClass odd ; tbody tr even this removeClass odd addClass even ; return this; ; document
 

code

geshibot lang javascript" head This is a JS snippet from Geshi Bot" Replaces the geshi default classes with mambo joomla classes function replaceGeshiWithMamboClasses if document document getElementsByTagName Category
 

OOPS Tutorials

Object oriented programming OOP is a computer science term used to characterize a programming language that began development in the 1960’ s The term object oriented programming’ was originally coined by Xerox PARC to designate a computer application that describes the methodol
 

C++ Void Pointer and Null Pointer

C Void Pointer and Null Pointer In this C tutorial you will learn about two interesting types of pointers; void pointers and Null Pointer These pointers will be discussed in conjunction with syntax usage and example mosgoogle center Pointer to Void General Syntax void pointer variable; Void is use
 

The Inheritance Concept In OOPs

The Inheritance Concept In OOPs In object oriented programming objects will be characterised by classes It is possible to learn a lot about an object based on the class it belongs to Even if you are not familiar with the name Maybach If I told you it is a car you would immediately know that it has f
 

Understanding The Message Concept In OOPs

Understanding The Message Concept In OOPs To understand object oriented programming you will need to become familiar with messages As the name implies a message is a process in which software objects will communicate with one another Because of this having one object is not enough mosgoogle An objec
 

Basic concepts of OOPS and Structure of C++ program

Basic concepts of OOPS and Structure of C program In this tutorial you will learn about Objects Classes Inheritance Data Abstraction Data Encapsulation Polymorphism Overloading Reusability Before starting to learn C it is essential that one must have a basic knowledge of the concepts of Object orie
 

How Code Reviews and PMD Can Crush Bugs In Your Code

How Code Reviews and PMD Can Crush Bugs In Your Code The ability to review your code is one of the best methods to find bugs and other issues which can cause your program to perform poorly In fact one of the hardest things about writing a program is debugging it When programmers get together and sha
 

Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape