Skip to main content

Questions tagged [array]

An array is a systematic arrangement of similar objects, usually in rows and columns.

Filter by
Sorted by
Tagged with
3 votes
2 answers
890 views

Should the 12-String be in its own class and why?

This question is regarding a homework project in my first Java programming class (online program). The assignment is to create a "stringed instrument" class using (among other things) an array of ...
MayNotBe's user avatar
  • 193
6 votes
3 answers
533 views

Generating Deep Arrays: Shallow to Deep, Deep to Shallow or Bad idea?

I'm working on an array structure that will be used as the data source for a report template in a web app. The data comes from relatively complex SQL queries that return one or many rows as one ...
Will's user avatar
  • 233
0 votes
1 answer
1k views

Java Dynamic Binding

I am having trouble understanding the OOP Polymorphic principl of Dynamic Binding ( Late Binding ) in Java. I looked for question pertaining to java, and wasn't sure if a overall answer to how dynamic ...
Chris Okyen's user avatar
-2 votes
4 answers
2k views

C simple arrays and pointers question

So here's the confusion, let's say I declare an array of characters char name[3] = "Sam"; and then I declare another array but this time using pointers char * name = "Sam"; What's the difference ...
Nash Vail's user avatar
  • 101
3 votes
3 answers
1k views

Is there a way to add unique items to an array without doing a ton of comparisons?

Please bare with me, I want this to be as language agnostic as possible becuase of the languages I am working with (One of which is a language called PowerOn). However, most languanges support for ...
Chad Harrison's user avatar
0 votes
3 answers
25k views

2 Dimensional Arrays in C++

I started learning arrays in C++ and came over a little side note in the book talking about 2D arrays in breif. I tested it out and i was amazed that it could give the programmer the ability to store ...
Mohamed Ahmed Nabil's user avatar
2 votes
2 answers
2k views

Should I create specific classes for JSON Objects or only use the container(Array/Dictionary) for accessing Data?

I'm using Foursquare to get a List of Restaurants nearby inside an iOS app. The Result is stored in an Array which consists of Dictionaries and regarding how deep the Data is, each Dictionary contains ...
twickl's user avatar
  • 123
4 votes
3 answers
6k views

C Flexible Arrays: When did they become part of the standard?

I learned to program in C many years ago, and used C steadily for about 10 years. These days, I occasionally have to look at C code, because our Informix 4GL RDS customized runners also contain C ...
octopusgrabbus's user avatar
0 votes
2 answers
693 views

arrays format (Javascript)

I have a list of users, with minions, something like this: User52: minion10 minion12 User32: minion13 minion11 I've been keeping in an array where the "location" is the id, ...
Joaolvcm's user avatar
  • 183
13 votes
8 answers
51k views

What is the difference between an Array and a Stack?

According to Wikipedia, a stack: is a last in, first out (LIFO) abstract data type and linear data structure. While an array: is a data structure consisting of a collection of elements (values ...
Dynamic's user avatar
  • 5,746
6 votes
6 answers
2k views

why are both index[array] and array[index] valid in C?

For example consider: int index = 3; int array[4] = {0, 1, 2, 3}; then both index[array] and array[index] are valid expressions, much like *(index + array) and *(array + index). In C arrays why is ...
Cam's user avatar
  • 526
6 votes
2 answers
5k views

How to remove the boundary effects arising due to zero padding in scipy/numpy fft?

I have made a python code to smoothen a given signal using the Weierstrass transform, which is basically the convolution of a normalised gaussian with a signal. The code is as follows: #Importing ...
Omkar's user avatar
  • 161
1 vote
1 answer
2k views

Is there a more efficient way to filter large arrays than preg_match()?

I have a log that our web application builds. Each month it contains around 16,000 entries of a string with about the average sentence worth of text. To filter/search through these in our admin panel ...
hozza's user avatar
  • 293
4 votes
3 answers
20k views

Subscript binding and array categories

I am learning "Programming languages principles" and there is a lot of information about stuff which make up a programming language . Unfortunately every material I came across until now has a lot of ...
progammer's user avatar
  • 751
9 votes
3 answers
8k views

Ordered enumeration: IEnumerable or Array (in C#)?

Typical context: I make an extension method for a collection which considers that the elements are ordered. The function starts at the beginning, at index 0, and the order has significance. Examples: ...
MPelletier's user avatar
  • 2,058
4 votes
3 answers
17k views

Best practice Java - String array constant and indexing it

For string constants its usual to use a class with final String values. But whats the best practice for storing string array. I want to store different categories in a constant array and everytime a ...
500865's user avatar
  • 305
2 votes
4 answers
562 views

Algorithm design for comparing split times in a race

I need to determine the ranking of values in an array without altering their position, so that I can print the position of each split time next to the actual value of the split time in a table like so....
jktress's user avatar
  • 123
4 votes
6 answers
3k views

Why isn't the line count in Visual Studio zero-based? [closed]

This just struck me as an oversight by Microsoft. Since arrays and other data-structures within the .NET framework begin from zero (zero-based) why don't we have a line 0 within the code view in ...
billy.bob's user avatar
  • 6,549
2 votes
3 answers
2k views

What are pros and cons of using temporary "references"?

In C and C++ (and I guess other languages that allow taking a "reference" to an array element or something similar), when you have an array like type, accessing individual elements of such an array ...
Martin Ba's user avatar
  • 7,637
4 votes
3 answers
3k views

Lisp: Benefits of lists as code over arrays as code?

Question for lisp programmers: Lisp code is lisp data, usually lists. Is there an advantage to code being lists over code being arrays? Would macros be easier to write/faster to run? You can ...
compman's user avatar
  • 1,387
0 votes
2 answers
1k views

Question regarding LinkedList in Java

When I was reading a book for SCJP, I came across the following paragraph. A LinkedList is ordered by index position, like ArrayList, except that the elements are doubly-linked to one another. ...
Vinoth Kumar C M's user avatar
112 votes
39 answers
106k views

Why are zero-based arrays the norm?

A question asked here reminded me of a discussion I had with a fellow programmer. He argued that zero-based arrays should be replaced with one-based arrays since arrays being zero-based is an ...

1 2 3 4
5