Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Diagnostics;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace BubbleSortĂ–vning
- {
- class Program
- {
- static void Main(string[] args)
- {
- }
- public String LinearSearch(Int32 length, Int32 repeats)
- {
- Random random = new Random(length);
- Stopwatch stopwatch = new Stopwatch();
- stopwatch.Start();
- for (Int32 i = 0; i < repeats; i++)
- {
- Int32 item = random.Next(length);
- // INCLUDE THE LINEAR SEARCH HERE
- }
- stopwatch.Stop(); return repeats +
- "linear searches in [ms]: " +
- stopwatch.ElapsedMilliseconds;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement