Category "arrays"

javascript merge sort and recursion

I am trying to understand how JavaScript merge sort function work. And I struggle understanding how the recursive function work. This is the code: const mergeSo

Swift Array extension for standard deviation

I am frequently needing to calculate mean and standard deviation for numeric arrays. So I've written a small protocol and extensions for numeric types that seem

How to parse a string to array in js

I have an a string like the following, var x = "[{"k":"1"}]"; console.log(x[0].K); I ant hange this string sine I am getting from the server.Its out of my co

Resizing an array by a non-constant, continually

I’d like to perform amortized analysis of a dynamic array: When we perform a sequence of n insertions, whenever an array of size k fills up, we reallocate

Creating an Array from a Range in VBA

I'm having a seemingly basic problem but can't find any resources addressing it. Simply put, I just want to load the contents of a Range of cells (all one colu

Find the Max value of an Array column and find associated value in another Array with in the dataframe

I have a csv file with below data. Id Subject Marks 1 M,P,C 10,8,6 2 M,P,C 5,7,9 3 M,P,C 6,7,4 I Need to find out Max value in the Marks column for each Id an

check that a word is an isogram with pure javascript

How do i check that a given word is an isogram with pure javascript, using a function. the function must return true or false. An isogram is a word with a repe

Arduino C++ - call registers by arrays

I am using a Teensy with Teensyduino to control several stepper motors. This requires writing to timer value registers, and there are 4 needed for each stepper

Sort multidimensional array by column value within a column

I have an array in PHP and I need to sort by a nested array inside of the array... Here is my array: Array ( [0] => Array ( [project_

PHP array, move keys and values to new array, but mix it up

so I need to convert a PHP array i'm getting from a form post, so that I can use it more usefully in a db. Array ( [first_name] => Array ( [0]

Using lodash push to an array only if value doesn't exist?

I'm trying to make an array that if a value doesn't exist then it is added but however if the value is there I would like to remove that value from the array as

Longest K Sequential Increasing Subsequences

Why I created a duplicate thread I created this thread after reading Longest increasing subsequence with K exceptions allowed. I realised that the person who wa

Count how many iterations of deletion until array is ordered

I'm trying to write a program whose input is an array of integers, and its size. This code has to delete each element which is smaller than the element to the l

How do I average the elements that are above a threshold in an array?

I am trying to average all the elements that are above 150 in an array. I can't figure out how to make it all work out and output the correct numbers. Can anyon

How do I average the elements that are above a threshold in an array?

I am trying to average all the elements that are above 150 in an array. I can't figure out how to make it all work out and output the correct numbers. Can anyon

What is the correct way to access the columns in NumPy?

I cannot figure out the following problem: Elements that were placed at the corners of an 4X3 array are selected. The row indices of the selected items are [0

C# check object type against multiple types

IS there a way to pass an array of types to the "is" operator? I am trying to simplify the syntax of checking an object against multiple types. Something like

Splicing objects from an array Javascript

I am trying to remove an object from an array if a particular value for a key matches a given string: Example data: array = [{_id: "abc", test: "123"},

How to assign value to zero-length array defined by ctypes in Python3

Here I have a class defined like below, whose attribute data is a zero-length array. How to instantiate this class? class Frame(ctypes.Structure): _fields_

plotting data from a list in python

I need to plot the velocities of some objects(cars). Each velocity are being calculated through a routine and written in a file, roughly through this ( I have