Posts

Showing posts from December 27, 2018

Order complexity of a pairing function

Image
0 I have a code that involves a 2 to 1 pairing of numbers. The code for this is function [ A ] = CantorPairing( B ) [~, b] =(size(B)); %b=sqrt(b); k=1; A=zeros(1,b/2); for i=1:2:(b) if( B(i)< B(i+1)) A(k)= B(i)+(B(i+1))^2; else A(k)= (B(i))^2+B(i)+B(i+1); end k=k+1; end This is a matlab code that i am implementing. What this code does is, it pairs the adjacent elements of an array B depending on which is greater. So for an n size array the number of elements it returns is n/2. I have a few questions for this code. Since I am new to computer science, I don't think this is a very efficient code in MATLAB, can I optimize this code. What is the order complexity of

United States International like Windows

Image
0 I am using Linux Mint on my laptop with a standard Qwerty keyboard. Is there any way of me using the same United States International keyboard layout like on Windows? So ") immediately works and shift ' twice won't end up with 2 dots in the air. I just want my keyboard layout to act 100% like Windows' United States International keyboard. keyboard-layout share | improve this question edited Dec 16 at 3:54 Rui F Ribeiro 38.9k 14 79 129 asked Oct 7 '15 at 13:27 Josh