From 6bf15a5c42f9ff942ebd7de90028ee41413b96f1 Mon Sep 17 00:00:00 2001 From: Swastyy Date: Wed, 14 Jul 2021 11:14:55 +0000 Subject: [PATCH 01/16] arrays --- en/Data Structures/Arrays/array.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 en/Data Structures/Arrays/array.md diff --git a/en/Data Structures/Arrays/array.md b/en/Data Structures/Arrays/array.md new file mode 100644 index 00000000..05ee8f13 --- /dev/null +++ b/en/Data Structures/Arrays/array.md @@ -0,0 +1,27 @@ +# Arrays + +Arrays are most basic data structures used in programming. Arrays are the data structures that contains group of elements. Typically these elements are all of the same data type, such as char or an int. +All arrays consist of contiguous memory locations. We can access the elements with their index. The lowest address corresponds to the first element and the highest address to the last element. +

+ +

+ +**Array Declaration** +`type arrayName [ arraySize ];` +type is the datatype of array elements + +**Array Initialization** +`int array1[] = {1,2,3};` + +**Accessing Elements of Array** +`int variable1 = array[0];` + + +# Source + +- [Arrays introduction](https://www.geeksforgeeks.org/introduction-to-arrays/) + +# YouTube + +- [Video Tutorial](https://youtu.be/NptnmWvkbTw) +- [Video for understanding Arrays in C++](https://youtu.be/ibeGtDEQGz0) From 624688d1fd0c0c7a87c5e89f55bd1f590a045148 Mon Sep 17 00:00:00 2001 From: Swastika Gupta <64654203+Swastyy@users.noreply.github.com> Date: Thu, 15 Jul 2021 14:15:33 +0530 Subject: [PATCH 02/16] Update en/Data Structures/Arrays/array.md Co-authored-by: David Leal --- en/Data Structures/Arrays/array.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/Data Structures/Arrays/array.md b/en/Data Structures/Arrays/array.md index 05ee8f13..1910840b 100644 --- a/en/Data Structures/Arrays/array.md +++ b/en/Data Structures/Arrays/array.md @@ -1,6 +1,6 @@ # Arrays -Arrays are most basic data structures used in programming. Arrays are the data structures that contains group of elements. Typically these elements are all of the same data type, such as char or an int. +Arrays are the most basic data structures used in programming. Arrays are data structures that contain a group of elements. Typically these elements are all of the same data type, such as `char` or `int`.\ All arrays consist of contiguous memory locations. We can access the elements with their index. The lowest address corresponds to the first element and the highest address to the last element.

From 22e1fd8da0e8985c6ce66e2f6960d3add24bcf30 Mon Sep 17 00:00:00 2001 From: Swastika Gupta <64654203+Swastyy@users.noreply.github.com> Date: Thu, 15 Jul 2021 14:15:41 +0530 Subject: [PATCH 03/16] Update en/Data Structures/Arrays/array.md Co-authored-by: David Leal --- en/Data Structures/Arrays/array.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/Data Structures/Arrays/array.md b/en/Data Structures/Arrays/array.md index 1910840b..e3566728 100644 --- a/en/Data Structures/Arrays/array.md +++ b/en/Data Structures/Arrays/array.md @@ -8,7 +8,7 @@ All arrays consist of contiguous memory locations. We can access the elements wi **Array Declaration** `type arrayName [ arraySize ];` -type is the datatype of array elements +`type` is the datatype of the array elements **Array Initialization** `int array1[] = {1,2,3};` From aa0108b08b17821bb54ec2f95f679e322892a521 Mon Sep 17 00:00:00 2001 From: Swastika Gupta <64654203+Swastyy@users.noreply.github.com> Date: Thu, 15 Jul 2021 14:15:48 +0530 Subject: [PATCH 04/16] Update en/Data Structures/Arrays/array.md Co-authored-by: David Leal --- en/Data Structures/Arrays/array.md | 1 - 1 file changed, 1 deletion(-) diff --git a/en/Data Structures/Arrays/array.md b/en/Data Structures/Arrays/array.md index e3566728..70b796b5 100644 --- a/en/Data Structures/Arrays/array.md +++ b/en/Data Structures/Arrays/array.md @@ -16,7 +16,6 @@ All arrays consist of contiguous memory locations. We can access the elements wi **Accessing Elements of Array** `int variable1 = array[0];` - # Source - [Arrays introduction](https://www.geeksforgeeks.org/introduction-to-arrays/) From c0227165b8706e67bd632760c23a854bf2343fa9 Mon Sep 17 00:00:00 2001 From: Swastika Gupta <64654203+Swastyy@users.noreply.github.com> Date: Thu, 15 Jul 2021 14:15:57 +0530 Subject: [PATCH 05/16] Update en/Data Structures/Arrays/array.md Co-authored-by: David Leal --- en/Data Structures/Arrays/array.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/Data Structures/Arrays/array.md b/en/Data Structures/Arrays/array.md index 70b796b5..48143439 100644 --- a/en/Data Structures/Arrays/array.md +++ b/en/Data Structures/Arrays/array.md @@ -18,7 +18,7 @@ All arrays consist of contiguous memory locations. We can access the elements wi # Source -- [Arrays introduction](https://www.geeksforgeeks.org/introduction-to-arrays/) +- [Introduction to arrays](https://www.geeksforgeeks.org/introduction-to-arrays/) # YouTube From 0d5b7caa892efbc516429a8fd3ceb1c21ca7ba48 Mon Sep 17 00:00:00 2001 From: David Leal Date: Thu, 15 Jul 2021 14:27:45 -0500 Subject: [PATCH 06/16] Apply suggestions from code review --- en/Data Structures/Arrays/array.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/en/Data Structures/Arrays/array.md b/en/Data Structures/Arrays/array.md index 48143439..41d5de5a 100644 --- a/en/Data Structures/Arrays/array.md +++ b/en/Data Structures/Arrays/array.md @@ -1,7 +1,8 @@ # Arrays Arrays are the most basic data structures used in programming. Arrays are data structures that contain a group of elements. Typically these elements are all of the same data type, such as `char` or `int`.\ -All arrays consist of contiguous memory locations. We can access the elements with their index. The lowest address corresponds to the first element and the highest address to the last element. +All arrays consist of contiguous memory locations. We can access the elements with their index. The lowest address corresponds to the first element, and the highest address to the last element. +

From 6a5ccfce1be6d959e462db77ddfc46fa98defd1f Mon Sep 17 00:00:00 2001 From: Swastika Gupta <64654203+Swastyy@users.noreply.github.com> Date: Tue, 20 Jul 2021 09:33:54 +0530 Subject: [PATCH 07/16] Update en/Data Structures/Arrays/array.md Co-authored-by: Rak Laptudirm --- en/Data Structures/Arrays/array.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/Data Structures/Arrays/array.md b/en/Data Structures/Arrays/array.md index 41d5de5a..2aee1bee 100644 --- a/en/Data Structures/Arrays/array.md +++ b/en/Data Structures/Arrays/array.md @@ -1,6 +1,6 @@ # Arrays -Arrays are the most basic data structures used in programming. Arrays are data structures that contain a group of elements. Typically these elements are all of the same data type, such as `char` or `int`.\ +Arrays are the most basic data structures used in programming. They contain a group of a fixed number of elements which occupy the same space in memory, i.e., the memory occupied is known at compile time. Thus arrays are stored in the stack and it's values can be saved and retrieved very quickly, in `O(1)` time. Languages like `Rust` which allows for `enums` in Arrays, each element occupies the maximum space which could be required by it. All arrays consist of contiguous memory locations. We can access the elements with their index. The lowest address corresponds to the first element, and the highest address to the last element.

From 632b624d2819b83469a3ad808b774cf26dabbbbf Mon Sep 17 00:00:00 2001 From: Swastika Gupta <64654203+Swastyy@users.noreply.github.com> Date: Tue, 20 Jul 2021 09:35:28 +0530 Subject: [PATCH 08/16] Update array.md --- en/Data Structures/Arrays/array.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/en/Data Structures/Arrays/array.md b/en/Data Structures/Arrays/array.md index 2aee1bee..1aaefa77 100644 --- a/en/Data Structures/Arrays/array.md +++ b/en/Data Structures/Arrays/array.md @@ -7,10 +7,6 @@ All arrays consist of contiguous memory locations. We can access the elements wi

-**Array Declaration** -`type arrayName [ arraySize ];` -`type` is the datatype of the array elements - **Array Initialization** `int array1[] = {1,2,3};` From 7864b4543f3398c21e6b5c3a42035a6e0fb67454 Mon Sep 17 00:00:00 2001 From: Swastika Gupta <64654203+Swastyy@users.noreply.github.com> Date: Tue, 20 Jul 2021 09:36:35 +0530 Subject: [PATCH 09/16] Update array.md --- en/Data Structures/Arrays/array.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/en/Data Structures/Arrays/array.md b/en/Data Structures/Arrays/array.md index 1aaefa77..78fd4c91 100644 --- a/en/Data Structures/Arrays/array.md +++ b/en/Data Structures/Arrays/array.md @@ -7,9 +7,6 @@ All arrays consist of contiguous memory locations. We can access the elements wi

-**Array Initialization** -`int array1[] = {1,2,3};` - **Accessing Elements of Array** `int variable1 = array[0];` From 622d704965eb9dc6527169742acf15fff82bf6fc Mon Sep 17 00:00:00 2001 From: Swastika Gupta <64654203+Swastyy@users.noreply.github.com> Date: Tue, 20 Jul 2021 09:43:12 +0530 Subject: [PATCH 10/16] Update array.md --- en/Data Structures/Arrays/array.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/en/Data Structures/Arrays/array.md b/en/Data Structures/Arrays/array.md index 78fd4c91..024ca678 100644 --- a/en/Data Structures/Arrays/array.md +++ b/en/Data Structures/Arrays/array.md @@ -3,13 +3,6 @@ Arrays are the most basic data structures used in programming. They contain a group of a fixed number of elements which occupy the same space in memory, i.e., the memory occupied is known at compile time. Thus arrays are stored in the stack and it's values can be saved and retrieved very quickly, in `O(1)` time. Languages like `Rust` which allows for `enums` in Arrays, each element occupies the maximum space which could be required by it. All arrays consist of contiguous memory locations. We can access the elements with their index. The lowest address corresponds to the first element, and the highest address to the last element. -

- -

- -**Accessing Elements of Array** -`int variable1 = array[0];` - # Source - [Introduction to arrays](https://www.geeksforgeeks.org/introduction-to-arrays/) From f1ca3044311a560c0f53919acbdeb09b0106f57c Mon Sep 17 00:00:00 2001 From: Swastika Gupta <64654203+Swastyy@users.noreply.github.com> Date: Tue, 20 Jul 2021 10:10:45 +0530 Subject: [PATCH 11/16] Update en/Data Structures/Arrays/array.md Co-authored-by: David Leal --- en/Data Structures/Arrays/array.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/Data Structures/Arrays/array.md b/en/Data Structures/Arrays/array.md index 024ca678..de204e06 100644 --- a/en/Data Structures/Arrays/array.md +++ b/en/Data Structures/Arrays/array.md @@ -1,6 +1,6 @@ # Arrays -Arrays are the most basic data structures used in programming. They contain a group of a fixed number of elements which occupy the same space in memory, i.e., the memory occupied is known at compile time. Thus arrays are stored in the stack and it's values can be saved and retrieved very quickly, in `O(1)` time. Languages like `Rust` which allows for `enums` in Arrays, each element occupies the maximum space which could be required by it. +Arrays are the most basic data structures used in programming. They contain a group of a fixed number of elements that occupy the same space in memory. I.e., the memory occupied is known at compile time. Thus arrays are stored in the stack, and their values can be saved and retrieved very quickly in `O(1)` time. Languages like `Rust` which allows `enums` in Arrays, each element occupies the maximum space which could be required by it. All arrays consist of contiguous memory locations. We can access the elements with their index. The lowest address corresponds to the first element, and the highest address to the last element. # Source From 17d095505ac756617882d7e430c9735c97d9e925 Mon Sep 17 00:00:00 2001 From: Swastika Gupta <64654203+Swastyy@users.noreply.github.com> Date: Tue, 20 Jul 2021 10:11:01 +0530 Subject: [PATCH 12/16] Update en/Data Structures/Arrays/array.md Co-authored-by: David Leal --- en/Data Structures/Arrays/array.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/Data Structures/Arrays/array.md b/en/Data Structures/Arrays/array.md index de204e06..e68f3dc4 100644 --- a/en/Data Structures/Arrays/array.md +++ b/en/Data Structures/Arrays/array.md @@ -9,5 +9,5 @@ All arrays consist of contiguous memory locations. We can access the elements wi # YouTube -- [Video Tutorial](https://youtu.be/NptnmWvkbTw) +- [YouTube URL tutorial video](https://youtu.be/NptnmWvkbTw) - [Video for understanding Arrays in C++](https://youtu.be/ibeGtDEQGz0) From 4a52d48e1c089dc25d2a321d7df1605f83b596c0 Mon Sep 17 00:00:00 2001 From: Swastika Gupta <64654203+Swastyy@users.noreply.github.com> Date: Tue, 20 Jul 2021 10:11:12 +0530 Subject: [PATCH 13/16] Update en/Data Structures/Arrays/array.md Co-authored-by: David Leal --- en/Data Structures/Arrays/array.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/Data Structures/Arrays/array.md b/en/Data Structures/Arrays/array.md index e68f3dc4..685881d2 100644 --- a/en/Data Structures/Arrays/array.md +++ b/en/Data Structures/Arrays/array.md @@ -10,4 +10,4 @@ All arrays consist of contiguous memory locations. We can access the elements wi # YouTube - [YouTube URL tutorial video](https://youtu.be/NptnmWvkbTw) -- [Video for understanding Arrays in C++](https://youtu.be/ibeGtDEQGz0) +- [YouTube video for understanding Arrays in C++](https://youtu.be/ibeGtDEQGz0) From 0f2a9ce59480f2421eae5fb2075bde44c3f4c419 Mon Sep 17 00:00:00 2001 From: Swastika Gupta <64654203+Swastyy@users.noreply.github.com> Date: Sat, 24 Jul 2021 21:18:03 +0530 Subject: [PATCH 14/16] Update array.md --- en/Data Structures/Arrays/array.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/Data Structures/Arrays/array.md b/en/Data Structures/Arrays/array.md index 685881d2..9212267e 100644 --- a/en/Data Structures/Arrays/array.md +++ b/en/Data Structures/Arrays/array.md @@ -1,6 +1,6 @@ # Arrays -Arrays are the most basic data structures used in programming. They contain a group of a fixed number of elements that occupy the same space in memory. I.e., the memory occupied is known at compile time. Thus arrays are stored in the stack, and their values can be saved and retrieved very quickly in `O(1)` time. Languages like `Rust` which allows `enums` in Arrays, each element occupies the maximum space which could be required by it. +Arrays are the most basic data structures used in programming. They contain a group of a fixed number of elements that occupy the same space in memory. I.e., the memory occupied is known at compile time. The values of elements in an array can be retrieved very quickly in `O(1)` time. All arrays consist of contiguous memory locations. We can access the elements with their index. The lowest address corresponds to the first element, and the highest address to the last element. # Source From 2ce1293fc57edab290403eae890a0cc2a3cbbf69 Mon Sep 17 00:00:00 2001 From: Swastika Gupta <64654203+Swastyy@users.noreply.github.com> Date: Sun, 25 Jul 2021 23:35:53 +0530 Subject: [PATCH 15/16] Update en/Data Structures/Arrays/array.md Co-authored-by: David Leal --- en/Data Structures/Arrays/array.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/Data Structures/Arrays/array.md b/en/Data Structures/Arrays/array.md index 9212267e..4d28cbdb 100644 --- a/en/Data Structures/Arrays/array.md +++ b/en/Data Structures/Arrays/array.md @@ -5,7 +5,7 @@ All arrays consist of contiguous memory locations. We can access the elements wi # Source -- [Introduction to arrays](https://www.geeksforgeeks.org/introduction-to-arrays/) +- [Introduction to arrays - GeeksForGeeks](https://www.geeksforgeeks.org/introduction-to-arrays/) # YouTube From ed53590845025d9af5b4717148c02824740008d4 Mon Sep 17 00:00:00 2001 From: Swastika Gupta <64654203+Swastyy@users.noreply.github.com> Date: Mon, 16 Aug 2021 13:57:24 +0530 Subject: [PATCH 16/16] Update array.md --- en/Data Structures/Arrays/array.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/en/Data Structures/Arrays/array.md b/en/Data Structures/Arrays/array.md index 4d28cbdb..5f085aa9 100644 --- a/en/Data Structures/Arrays/array.md +++ b/en/Data Structures/Arrays/array.md @@ -1,6 +1,7 @@ # Arrays -Arrays are the most basic data structures used in programming. They contain a group of a fixed number of elements that occupy the same space in memory. I.e., the memory occupied is known at compile time. The values of elements in an array can be retrieved very quickly in `O(1)` time. +Arrays are the most basic data structures used in programming. There are two types of arrays - static arrays and dynamic arrays. Static arrays contain a group of a fixed number of elements that occupy the same space in memory. I.e., the memory occupied is known at compile time whereas in the case of dynamic arrays the size is not fixed. +The values of elements in an array can be retrieved very quickly in `O(1)` time. All arrays consist of contiguous memory locations. We can access the elements with their index. The lowest address corresponds to the first element, and the highest address to the last element. # Source