Category "arrays"

How to make binary tree from array in javascript?

I have an array var array = [8,10,12,5,3,6]; Logic First node would be root node. If new node value is less or equal =< than parent node, It would be left

How do you remove duplicate values in array in Python?

I have an array where each element is the mean of a set of random numbers. I want to be able to remove duplicate values in this array. How would I go about doin

Excel array countif formula

I want to use COUNTIF function to evaluate how many items out of 2,0,0,5 are greater than 2? In Countif function, first argument is range and second is criteria

C++ Read txt and put each line into Dynamic Array

I am trying to read input.txt file, and trying to put each line into the array as string (later on I will use each element of array in initializing obj that's w

Vector reversal using recursion

I'm supposed to reverse the order of an array. I was asked to break the array into two halves and run two recursive functions on each half. When I run the funct

Find an object with certain private value in a java Collection

I am currently coding a game that uses an 8x8 grid. I have to stock a domino (2x1 size) in the grid for every player but when a player wants to add a Domino to

Find the Max and Min element out of all the nested arrays in javascript

I have a array like so: var arr = [[12,45,75], [54,45,2],[23,54,75,2]]; I want to find out the largest element and the smallest element out of all the elemen

How to convert all string in Dart list to lowercase?

I want check if Dart list contain string with list.contains so must convert string in array to lowercase first. How to convert all string in list to lowercase?

The dimension orders of the Numpy 3D array are designed to z, x, y. Are there any advantages?

I think that the x,y,z order is more intuitive for a 3D array, just as Matlab does. For example, If someone tells me an array is 2x3x4, I will think it is 2 row

how to Save Inputted Values ​from Edittext into Array?

I am making a program to get Values ​​from edittext and store it in an array then I want to display that array on screen and here is my command Edi

searching multiple Object Value in another Object JavaScript

I have 2 array of object in that, I want to compare all of the first array object property and value present in the second array of object. (at the object level

searching multiple Object Value in another Object JavaScript

I have 2 array of object in that, I want to compare all of the first array object property and value present in the second array of object. (at the object level

Moving PostgreSQL bigint array unique value to another index

How can I move the array bigint value from one index to another? For example, I have an array ARRAY[1, 2, 3, 4] of bigint unique values and want to move value 1

Given an array of integers, find the pair of adjacent elements that has the largest product and return that product

Given an array of integers, find the pair of adjacent elements that has the largest product and return that product. and here is my code function adjacentEle

Swift 4 - How to return a count of duplicate values from an array? [duplicate]

I have an array with multiple values (Doubles), many of which are duplicates. I'd like to return or print a list of all unique values, along

How to limit properties of a JSON object given array of property names using JQ?

Assuming I have the following JSON object (which is just an example): { "foo": 1, "bar": 2, "baz": 3 } And the following JSON array (another example)

PHP: set a (deep) array key from an array [closed]

is there a PHP function that would create a (deep) array key from an array ? It's quite difficult to explain, see that example: function myst

"Notice: Undefined variable", "Notice: Undefined index", "Warning: Undefined array key", and "Notice: Undefined offset" using PHP

I'm running a PHP script and continue to receive errors like: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php on line 10 Notice: U

Better way to modify values in a single array to different format

This may be a duplicate question. But I didn't find any similar questions in this forum. I'm trying to modify values in an array to different format. arrayInput

Finding number of inversions in given array

I have written the following code to find the inversions in array {1,4,2,5,3} by using merge sort technique. I have been debugging it to the best of my knoledge