Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Concurrent bag ex
//Title of this code //Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Threading.Tasks; using System.Collections.Concurrent; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here ConcurrentBag<int> bag = new ConcurrentBag<int>(); bag.Add(42); bag.Add(21); int result; if(bag.TryTake(out result)) Console.WriteLine(result); if(bag.TryPeek(out result)) Console.WriteLine(result); } } }
run
|
edit
|
history
|
help
0
Simple StackOverflowException
practice
1
Task 1_4
project euler 18
Importent Gen_Coverent Example-1
linked list (add to end and beginning, and looking for cycles based on Floyd's algorithm)
convert a string of numbers to a list then use a forEach to loop through the list
Singly-linked IList<T> in C#
Binary search tree - Pre-order Traversal