i want this answer rapidly plz

Pages: 12
what is the difference between stack and queue and linked list
plz can you write a Brief answer ??
The pictures you see at the beginning of the wikipedia articles should give you an idea:
Stack: Last In, First Out
before:  1
push:    2,1
push:    3,2,1
pop:     2,1

Queue: First In, First Out
before:  1
push:    2,1
push:    3,2,1
pop:     3,2

Linked List:

List:
    Node1

Node1:
    value1
    Node2   (pointer to next node)

Node2:
    value2
    Node3

...
nice clue bazzy! now if he only reads carefully ;)
It might be helpful to think of real-world examples to remember them at first.

For a stack, think of a physical stack of books. It is added-to by placing another one on top (push) and to remove one you have to take the top one first (pop).

For a queue, think of a print queue. If someone prints a document first, their document will be printed first.

For linked lists, think of the links (nodes) in a chain. There is a beginning (root node) and each link only connects to the next adjacent one.
thnx bazzy , BettyBoopTS ,moorecm for your efforts
Last edited on
can we use binary search algorithm with sorted linked list? explain why???
i think no.. but i'm not sure..

i believe binary search works with array and continuously dividing the index by two until it finds what you're trying to search.. linked list is like a train.. one part only care or points whats in front or behind of it.. in other words linked list don't use index..

again, i'm not sure.. please correct me guys..
tifa farouk, are you working on a test right now?
http://en.wikipedia.org/wiki/Binary_search :
In computer science, a binary search is an algorithm for locating the position of an element in a sorted list. It inspects the middle element of the sorted list...
You can't get to the middle of a linked list in an efficient way
yeah.. that's exactly what i want to say Bazzy.. i just can't express myself well in english.. thanks for helping..
thanks bazzy for this answer
Last edited on
His name is Bazzy. I wouldn't mind if you had mistyped it, but the pronunciation of 'buzzy' means gay in my language and that hurt my ears :\
The "official" pronunciation of 'Bazzy' is 'Buddzee' IPA: baddzi
- it has no real meaning -
Huh?

I don't understand. I think I'll leave you guys to it.

What country are you from, Bazzy?
I'm from Italy
I've been to Italy; but that was in winter, for skiing.
The pronunciation of buzzi['buzi] means gay in Hungarian, not Bazzy.

http://en.wiktionary.org/wiki/buzi
But that's really not something to argue on :).
now that's a hungarian notation! ; )
Pages: 12