Click here to Skip to main content
15,892,059 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Confused by team mate... Pin
Jon McKee21-Jul-20 19:55
professionalJon McKee21-Jul-20 19:55 
GeneralRe: Confused by team mate... Pin
Super Lloyd21-Jul-20 20:13
Super Lloyd21-Jul-20 20:13 
GeneralRe: Confused by team mate... Pin
David O'Neil21-Jul-20 20:26
professionalDavid O'Neil21-Jul-20 20:26 
GeneralRe: Confused by team mate... Pin
Super Lloyd21-Jul-20 20:34
Super Lloyd21-Jul-20 20:34 
GeneralRe: Confused by team mate... Pin
Jon McKee21-Jul-20 20:50
professionalJon McKee21-Jul-20 20:50 
GeneralRe: Confused by team mate... Pin
David O'Neil21-Jul-20 21:05
professionalDavid O'Neil21-Jul-20 21:05 
GeneralRe: Confused by team mate... Pin
F-ES Sitecore22-Jul-20 1:31
professionalF-ES Sitecore22-Jul-20 1:31 
GeneralRe: Confused by team mate... Pin
Jon McKee22-Jul-20 9:21
professionalJon McKee22-Jul-20 9:21 
In the general sense I completely agree, but:
F-ES Sitecore wrote:
In the original code a List was used to process something that isn't best represented as a List, it was data used as a stack or a queue so using Queue makes that explicit.

We don't really know this. All the function represents is a filter operation. The main purpose of the List outside of this function could require random access which is much more efficient on a List (O(1)) than a Queue (O(n)). Any filter operation is going to be at least O(n) since it requires processing all data elements. Both the List and Queue implementations have the same time complexity here. As written the Queue implementation has higher code complexity and space requirements though.
F-ES Sitecore wrote:
Also I don't think accessing the last item of a List using an index is very efficient.

Numerical indexing is O(1) for array-based List access since underneath everything it's just pointer arithmetic. I suppose they could be using a linked List implementation if they want O(1) add/remove complexity which would make random access O(n) but we really don't know. In the linked List case the underlying data structure is the same as the Queue anyways.
GeneralRe: Confused by team mate... Pin
F-ES Sitecore23-Jul-20 0:30
professionalF-ES Sitecore23-Jul-20 0:30 
GeneralRe: Confused by team mate... Pin
Jon McKee23-Jul-20 12:33
professionalJon McKee23-Jul-20 12:33 
GeneralRe: Confused by team mate... Pin
Johnny J.21-Jul-20 21:22
professionalJohnny J.21-Jul-20 21:22 
GeneralRe: Confused by team mate... Pin
OriginalGriff21-Jul-20 20:00
mveOriginalGriff21-Jul-20 20:00 
GeneralRe: Confused by team mate... Pin
Super Lloyd21-Jul-20 20:12
Super Lloyd21-Jul-20 20:12 
GeneralRe: Confused by team mate... Pin
OriginalGriff21-Jul-20 20:14
mveOriginalGriff21-Jul-20 20:14 
GeneralRe: Confused by team mate... Pin
Super Lloyd21-Jul-20 20:35
Super Lloyd21-Jul-20 20:35 
GeneralRe: Confused by team mate... Pin
Super Lloyd21-Jul-20 20:38
Super Lloyd21-Jul-20 20:38 
GeneralRe: Confused by team mate... Pin
OriginalGriff21-Jul-20 20:18
mveOriginalGriff21-Jul-20 20:18 
GeneralRe: Confused by team mate... Pin
Super Lloyd21-Jul-20 20:36
Super Lloyd21-Jul-20 20:36 
GeneralRe: Confused by team mate... Pin
Sander Rossel21-Jul-20 21:49
professionalSander Rossel21-Jul-20 21:49 
GeneralRe: Confused by team mate... Pin
5teveH21-Jul-20 22:24
5teveH21-Jul-20 22:24 
GeneralRe: Confused by team mate... Pin
F-ES Sitecore22-Jul-20 1:35
professionalF-ES Sitecore22-Jul-20 1:35 
RantRe: Confused by team mate... Pin
MehreenTahir22-Jul-20 4:14
MehreenTahir22-Jul-20 4:14 
GeneralRe: Confused by team mate... Pin
Super Lloyd22-Jul-20 5:00
Super Lloyd22-Jul-20 5:00 
GeneralRe: Confused by team mate... Pin
Marc Clifton22-Jul-20 4:14
mvaMarc Clifton22-Jul-20 4:14 
GeneralRe: Confused by team mate... Pin
Super Lloyd22-Jul-20 4:59
Super Lloyd22-Jul-20 4:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.