using System.Collections.Generic;
public static int BinarySearch(int[] arr, int lowBound, int highBound, int value)
while (lowBound <= highBound)
mid = (lowBound + highBound) / 2;
else if (arr[mid] > value)
public static void BubbelSort (List<string> loggBok)
for (int index = 0; index < (loggBok.Count - 1); index++)
if (string.Compare (loggBok[index], loggBok[index + 1]) < 0)
loggBok[index] = loggBok[index + 1];
loggBok[index + 1] = temp;
public static void Main()
List<string> loggBok = new List<string>();
string[] post = new string[3];
List<string> searchTitles = new List<string>();
DateTime tiden = DateTime.UtcNow;
Console.WriteLine("Vad väljer du?");
int.TryParse(Console.ReadLine(), out choice);
string date = Convert.ToString(tiden);
Console.WriteLine("Lägg till titel");
string titel = Console.ReadLine();
Console.WriteLine("Lägg till text");
string text = Console.ReadLine();
post[0] = Environment.NewLine + Nr + ". " + date;
post[1] = Nr + ". " + titel;
post[2] = Nr + ". " + text + Environment.NewLine;
loggBok.InsertRange(0,post);
Console.WriteLine(Environment.NewLine);
Console.WriteLine("Här är alla logg inlägg");
foreach (var posts in loggBok)
Console.WriteLine(posts);
Console.WriteLine("Skriv in titeln på inlägget du söker på");
string key = Console.ReadLine();
for(int i = 0; i < loggBok.Count; i++) {
Console.WriteLine(loggBok[h] + Environment.NewLine + loggBok[i] + Environment.NewLine + loggBok[l] + Environment.NewLine);
Console.WriteLine("Vill du radera inlägget?");
string radera = Console.ReadLine();
if(radera == "ja" || radera == "yes") {
Console.WriteLine("Skriv in första nummret på inlägget");
Console.WriteLine("Skriv in andra nummret på inlägget");
Console.WriteLine("Skriv in tredje nummret på inlägget");
foreach (var posts in loggBok)
Console.WriteLine(posts);
Console.WriteLine("Nope titeln finns inte");