Can we remove an element in a single linked list without
traversing?
Lets suppose the link list is like this
1 2 3 4 5 6
We need to remove 4 from this list (without traversing from
beginning) and the final link list shud be 1 2 3 5 6
only thing we know is the pointer to element "4". How can
we remove "4" and link "3" to "5"?
Answer Posted / codeg
it is not possible in Single AND double linked list without
traversing from first and not knowing addr of 4..
its possible in circular doubly linked list only........
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
what is data abstraction in C++?
What is meant by const_cast?
What are the uses of pointers?
What are the uses of typedef in a program?
What is linked list in c++?
What programming language should I learn first?
What is meant by the term name mangling in c++?
What is the this pointer?
How many different levels of pointers are there?
Define pointers?
Are vectors faster than arrays?
What is functions syntax in c++?
What are the advantages of inheritance in c++?
What is std :: endl?
A prime number is a number which is divisible only by itself and 1. Examples of the first few primes are 2, 3, 5, 7, 11. Consider writing a program which can generate prime numbers for you. Your program should read in and set a maximum prime to generate and a minimum number to start with when looking for primes. This program should be able to perform the following tasks: 1. Read the maximum number from user (keyboard input) to look for primes. The program should not return any primes greater than this number. 2. Read the minimum number from user (keyboard input) to look for primes. The program should not return any primes less than this number. 3. Generate and print out every prime number between the maximum prime and minimum number specified by the user.