https://github.com/erdemkeren/csharp-java-php-queue-implementation
Queue implementations utilizing LinkedList provided by the language (System.Collections.Generic, java.util.LinkedList, \SplDoublyLinkedList).
https://github.com/erdemkeren/csharp-java-php-queue-implementation
Last synced: 3 months ago
JSON representation
Queue implementations utilizing LinkedList provided by the language (System.Collections.Generic, java.util.LinkedList, \SplDoublyLinkedList).
- Host: GitHub
- URL: https://github.com/erdemkeren/csharp-java-php-queue-implementation
- Owner: erdemkeren
- License: gpl-3.0
- Created: 2019-03-08T16:40:14.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-08T17:00:19.000Z (about 6 years ago)
- Last Synced: 2025-01-17T19:44:24.341Z (5 months ago)
- Language: C#
- Size: 43.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# csharp-java-php-queue-implementation
Queue implementations utilizing LinkedList provided by the language (System.Collections.Generic, java.util.LinkedList, \SplDoublyLinkedList).# Inference
**Java Way** `LinkedList.pop()`removes and returns the first element of this list.
On the other hand, in **PHP**, `SplDoublyLinkedList->pop()` pops a node from the end of the doubly linked list regardless of the iterator mode (SplDoublyLinkedList::IT_MODE_FIFO or SplDoublyLinkedList::IT_MODE_LIFO).
In **C#**, there is no `Pop` method inside the `LinkedList` implementation. Methods like `Push`, `Pop` and `Peek` are the members of `System.Collections.Stack` and that's why you don't have access to these methods from LinkedLists. You can combine and use `void RemoveFirst()` and `TSource First()` to simulate the `Pop` behaviour.
Finally, in **Java** pop is also an alias of `E removeFirst()`. And you don't need to call `E getFirst` explicitly to implement `Pop` since it already returns the `T` variable.