Skip to content

Instantly share code, notes, and snippets.

View kunitsyn's full-sized avatar

Andriy Kunitsyn kunitsyn

  • Kharkiv, Ukraine
View GitHub Profile
@kunitsyn
kunitsyn / Program.cs
Last active April 26, 2020 15:41
Calculating "What is the value on the given index of array which is a sorted result of merging two given sorted arrays?" in O(log n) with O(1) memory
using System;
using System.Diagnostics;
using System.Linq;
namespace BinarySearchOlymp
{
class Program
{
private static int? FindValueByIndex(int[] array1, int[] array2, int index)
{
@kunitsyn
kunitsyn / Program.cs
Last active April 25, 2020 11:57
Binary searching imaginary sorted merge of two sorted arrays
using System;
using System.Diagnostics;
using System.Linq;
namespace BinarySearchOlymp
{
class Program
{
enum ResultType { FOUND, NOT_FOUND };
struct BinarySearchResult { public ResultType type; public int index; };