Skip to main content

All Questions

Tagged with
-1 votes
2 answers
50 views

C++ Rectangle 2D Array with numbers beside the rectangle

I've been trying to make a 2D array of rectangle, and i want the number of index x to printed beside the rectangle and index y to be printed below the rectangle.. Here is my code.. int height, width; ...
ken's user avatar
  • 1
-8 votes
0 answers
28 views

How to get and sort a string from an array in javascript? [closed]

I have this array with this string: ['MEX-CUN'] ['MEX-MTY'] and I would like a result similar to this: CUNMEX MEXMTY Is it possible to perform this action?
dany952's user avatar
  • 303
1 vote
1 answer
50 views

Filter multideminsional array in PHP so that if certain values are duplicated in sub-arrays the redundant ones are unset [closed]

In an application, redundant but non-identical arrays are being returned. I'd like to remove the redundant arrays from the multidimensional array. Though the issue could possibly be solved closer to ...
CK MacLeod's user avatar
  • 1,050
2 votes
2 answers
45 views

Angular - Passing a dynamic string property name to Sort and object array

I am trying to dynamically sort a simple object by the property name. sampleArr: { name: string; age: number; }[ ] = [ { name: "Michael", age: 21}, { name: "Adam&...
michael's user avatar
  • 35
-1 votes
1 answer
30 views

Why I receive an unknown variable error in my function?

I'm using AlgoBuild and inside the "input_vet()" function there's a while loop and in its condition I recall the variable N, which I assign a value in the main, and shows a unknown variable ...
giuamato50's user avatar
0 votes
1 answer
45 views

Sorting with AlgoBuild. Why do I get an index is out of range error?

I am using AlgoBuild to make a program that sorts numbers. This is my attempt: AlgoBuild translates this chart to the following pseudo code: PROGRAM main INPUT int D FOR i = 0; i < D; i = ...
giuamato50's user avatar
-1 votes
5 answers
126 views

How do I sort 13 random playing cards in order (sequence) in java?

I want to order 13 playing cards with order clubs, diamonds, hearts and spades, sequence 2,3,4,5,6,7,8,9,10,J,Q,K,A. For example 4C means "4 Club". I tried using the code below to order them ...
Dedetok's user avatar
  • 49
-1 votes
2 answers
107 views

how do I connect two arrays and sort only one of them in c++? [duplicate]

So I'm new to C++ and doing that one Buzzy's exercise with pancakes. But I have absolutely no idea how to solve the last part of it: Modify the program so that it outputs a list in order of number of ...
gilewicz's user avatar
3 votes
4 answers
134 views

sorting algorithm in O(n) according a specific condition

Given an array A with n−1 numbers where n = 2^k for some integer k. One of the values appears exactly n/2 another appears exactly n/4, and so on. More formally, for all 1 ≤ k ≤ log n exists a value ...
GuyNet's user avatar
  • 31
0 votes
1 answer
82 views

How can I find the median of two sorted arrays in O(log(m+n)) complexity

I copy the length of two initial arrays and then merge them into a third array and the length of the third array is equal to the length of initial two arrays added together. Then I try to find the ...
Fazeel Ayaz's user avatar
2 votes
2 answers
119 views

Is there a way to search an array of arrays for matching properties and if they match, make sure they aren't in adjacent positions?

I have been wracking my brain for a week on this problem and would appreciate any help or suggestions. I have a form that collects the users first name, last name and song. It stores those values in ...
Steven Wimer's user avatar
-1 votes
1 answer
40 views

How to write values into empty array from a loop dedicated to another function in Javascript?

I am doing a random sort of values according to the Fisher Yates method, and to explore the inside of this process I tried to out the random numbers (arsam1 is the number fixed set, iValue1 and ...
Adam Givon's user avatar
-1 votes
2 answers
77 views

char *array[200] sorting program doesn't read words

The program is expected to sort and display a list of words from a array whose elements are pointers to char. I use malloc to alocate space to each element and use a read_line function to store in the ...
Pepe Cuesta's user avatar
0 votes
1 answer
81 views

Python array sorting price incorrectly

I have made an array with a description and price but can't seem to get the sortign to sort by price. Can someone assist or guide me on why this isn't sorting by price correctly? I have checked the ...
Slippy's user avatar
  • 69
-2 votes
3 answers
111 views

Flatten a large array into a matrix

I've looked through a number of posts with similar titles but none seem to help me out with this code. I have a very large array (1200 rows, 48 columns, 6 slices). I'd like to flatten it into a matrix....
JDK's user avatar
  • 21

15 30 50 per page
1
2 3 4 5
1148