Data Structures Arrays - Answers to Arrays related interview questions

What are Arrays?

An array is a series of elements. These elements are of the same type. Each element can be individually accessed using an index. For e.g an array of integers. Array elements are stored one after another (contiguous) in the memory. An array can have more than one dimension. First element in an array starts with 0.

Explain two-dimensional array.

An array with two dimensions is called as a two-dimensional array. It is also called as a matrix. In C, a two dimensional array is initialized as int arr[nb_of_rows] [nb_of_columns]. Hence, two dimensional arrays can be considered as a grid. An element in a two dimensional can be accessed by mentioning its row and column. If the array has 20 integer values, it will occupy 80 bytes in memory (assuming 4 bytes for an integer). All of the bytes are in consecutive memory locations, the first row occupying the first 20 bytes, the second the next 20, and so on.

Define Array of pointers.

An array of pointers is an array consisting of pointers. Here, each pointer points to a row of the matrix or an element. E.g
char *array [] = {“a”, “b”}.
This is an array of pointers to to characters.
Linked list interview questions and answers - freshers, experienced
Data Structures Linked list - In this series, we have covered all about Linked list and answered the questions that might be asked during an interview.
Data Structures Sorting - Answers to Sorting related interview questions
Data Structures Sorting - In this series, we have covered all about Sorting and answered the questions that might be asked during an interview.
Data structures stack and queue interview questions - stack and queue interview
Data Structures Stack and Queue - In this series, we have covered all about Stack and Queueand answered the questions that might be asked during an interview.
Post your comment
Discussion Board
Feedback
it is better way all information given in short..but it explain with proper example then is to better...
shital 03-26-2015
reply
Its good but could be better if it was given with examples
Sindhu 01-2-2015
ds
thank full very east to understand..


A.prasanna 11-20-2014
easy
it is easy to understand and very short information
maha 08-21-2013
thanks
very useful...thnks...
Raghavi 07-11-2013
thanks
very useful...thnks...
Raghavi 07-11-2013
data structure
it was very help ful
prapti 09-25-2012
data structure
Excellent !!!!
ganesh 09-9-2012