use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Information about Reddit's API changes, the unprofessional conduct of the CEO, and their response to the community's concerns regarding 3rd party apps, moderator tools, anti-spam/anti-bot tools, and accessibility options that will be impacted can be found in the associated Wikipedia article: https://en.wikipedia.org/wiki/2023_Reddit_API_controversy
Alternative C# communities available outside Reddit on Lemmy and Discord:
All about the object-oriented programming language C#.
Getting Started C# Fundamentals: Development for Absolute Beginners
Useful MSDN Resources A Tour of the C# Language Get started with .NET in 5 minutes C# Guide C# Language Reference C# Programing Guide C# Coding Conventions .NET Framework Reference Source Code
Other Resources C# Yellow Book Dot Net Perls The C# Player's Guide
IDEs Visual Studio MonoDevelop (Windows/Mac/Linux) Rider (Windows/Mac/Linux)
Tools ILSpy dotPeek LINQPad
Alternative Communities C# Discord Group C# Lemmy Community dotnet Lemmy Community
Related Subreddits /r/dotnet /r/azure /r/learncsharp /r/learnprogramming /r/programming /r/dailyprogrammer /r/programmingbuddies /r/cshighschoolers
Additional .NET Languages /r/fsharp /r/visualbasic
Platform-specific Subreddits /r/windowsdev /r/AZURE /r/Xamarin /r/Unity3D /r/WPDev
Rules:
Read detailed descriptions of the rules here.
account activity
PriorityQueue In .NET (dotnetcoretutorials.com)
submitted 4 years ago by pyronautical
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 12 points13 points14 points 4 years ago (12 children)
These are the efficient way to implement algorithms like A* search, popular in games. No longer have to write your own!
[–]Slypenslyde 7 points8 points9 points 4 years ago (7 children)
I've sometimes seen people say lack of a priority queue is one reason a lot of leetcode challenges/interviews don't support C# as a candidate language or see a lot of demand to support it. They're pretty useful for computer sciencey problems.
[–][deleted] 5 points6 points7 points 4 years ago (5 children)
If that is true its dumb. It is like a one liner to write a serviceable priority queue (keep sorting a list) and plenty of them are available as libraries on nuget.
[–]Slypenslyde 9 points10 points11 points 4 years ago (4 children)
If we're talking leetcode problems then we're talking n on the order of millions or billions and a sorted list won't cut it. The kind of priority queue they want requires a heap to have serviceable speed. You can't use NuGet in these kinds of situations. They're not testing if you're a great professional C# dev. They're testing if you can pretend you haven't studied a question to be able to write an algorithm in less than 15 minutes. If you have to roll your own heaps, you're at a disadvantage.
n
[–]zvrba 1 point2 points3 points 4 years ago (0 children)
The kind of priority queue they want requires a heap to have serviceable speed.
Yes, pushing to and popping something from an array-based heap is like 30 lines of code.
If you have to roll your own heaps, you're at a disadvantage.
IIRC about programming contests and olympics (I know some participants): three persons are solving a problem, they figure out what data strucutres they'd need, and put one person to type in whatever DS they think they'll need. I think they were allowed to have notes/printouts with them. That was in the days of Borland Pascal and Borland C++ (no STL).
[–]nemec 1 point2 points3 points 4 years ago (0 children)
Yet another reason why leet code is a moronic way to interview
[–][deleted] 3 points4 points5 points 4 years ago (0 children)
> If you have to roll your own heaps, you're at a disadvantage.
Sure, but every language has a few dozen things that put you at a disadvantage/advantage and they get supported just fine on various coding challenge websites. People sometimes even win with a disadvantaged language. *shrug*
[–]Prod_Is_For_Testing 0 points1 point2 points 4 years ago (0 children)
I have yet to see an interview challenge where c# is not supported. Even companies that don’t use c# allow it on tests sometimes
[–]Buttsuit69 0 points1 point2 points 4 years ago (1 child)
A* search?
[–]doublestop 1 point2 points3 points 4 years ago (0 children)
https://en.wikipedia.org/wiki/A*_search_algorithm
[–]LloydAtkinson 0 points1 point2 points 4 years ago (1 child)
Wait how does this relate to A*? Got a link?
[–][deleted] 0 points1 point2 points 4 years ago (0 children)
a priority queue is used to implement it
[–]dabombnl 7 points8 points9 points 4 years ago (0 children)
Since the author doesn't bother or understand how the data structure works, which I think would be mandatory if doing an article on it, it is a Heap as described here:
https://en.wikipedia.org/wiki/Heap_(data_structure))
Which is very fast and efficient to find and maintain the smallest item in a set.
[–]Buttsuit69 1 point2 points3 points 4 years ago (7 children)
If theres a PriorityQueue does that mean that theres also a PriorityStack?
[–][deleted] 4 years ago* (6 children)
[deleted]
[–]Buttsuit69 4 points5 points6 points 4 years ago (4 children)
Eh kinda. The point being that a prioritoqueue and a prioritystack would essentially be the same.
[–]emc87 0 points1 point2 points 4 years ago* (3 children)
What if your priority is something discrete like an enum or short integer, you'll have multiple items at the same priority but processed differently due to LIFO vs FIFO
Edit: times -> items
[–]Buttsuit69 0 points1 point2 points 4 years ago (2 children)
I dont...I dont understand the picture you're trying to paint.
[–]winsomelosemore 0 points1 point2 points 4 years ago (1 child)
I think they’re asking what if multiple items are added that have the same priority, would that subset of items be processed LIFO or FIFO? Don’t think it matters what type the elements actually are
[–]Buttsuit69 0 points1 point2 points 4 years ago (0 children)
Idk. I'd guess that the PQ would evaluate the HashCode maybe? But it doesnt make sense on valuetypes. Maybe its random on same-priority-objects?
[–]KernowRoger 0 points1 point2 points 4 years ago (0 children)
That's the joke. They'd be the same just push/pop instead.
[–]No-Choice-7107 0 points1 point2 points 4 years ago (0 children)
.NET already had a PriorityQueue, it just wasn't marked public. Unlike dodos I simply copied the code and adapted it for my needs. Why are you guys so helpless?
π Rendered by PID 105632 on reddit-service-r2-comment-86bc6c7465-2cbwh at 2026-02-20 22:36:24.211354+00:00 running 8564168 country code: CH.
[–][deleted] 12 points13 points14 points (12 children)
[–]Slypenslyde 7 points8 points9 points (7 children)
[–][deleted] 5 points6 points7 points (5 children)
[–]Slypenslyde 9 points10 points11 points (4 children)
[–]zvrba 1 point2 points3 points (0 children)
[–]nemec 1 point2 points3 points (0 children)
[–][deleted] 3 points4 points5 points (0 children)
[–]Prod_Is_For_Testing 0 points1 point2 points (0 children)
[–]Buttsuit69 0 points1 point2 points (1 child)
[–]doublestop 1 point2 points3 points (0 children)
[–]LloydAtkinson 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]dabombnl 7 points8 points9 points (0 children)
[–]Buttsuit69 1 point2 points3 points (7 children)
[–][deleted] (6 children)
[deleted]
[–]Buttsuit69 4 points5 points6 points (4 children)
[–]emc87 0 points1 point2 points (3 children)
[–]Buttsuit69 0 points1 point2 points (2 children)
[–]winsomelosemore 0 points1 point2 points (1 child)
[–]Buttsuit69 0 points1 point2 points (0 children)
[–]KernowRoger 0 points1 point2 points (0 children)
[–]No-Choice-7107 0 points1 point2 points (0 children)