Array Abstract Data Type in C - Dot Net Tutorials
Array Abstract Data Type in C - Dot Net Tutorials
What is Algorithm
1. Representation of Data.
Analysis of Algorithm
2. Set of Operations on the Data.
Big-O Notation
Properties of Asymptotic C/C++ provides Array as a basic data structure. Representation of data is defined by the language compiler itself.
Notations But the operations on the data are not defined by the compiler. We have to implement or provide the operations on
Array data structure. So, data structure array and the set of operations together we can call it as Abstract Data
Master Theorem
Type (ADT).
Recursion And
BackTracking
Operations on Array Data Structure:
Essential Concepts of C and
C++ Programming Below is the list of some of the operations that we can perform on an array-
Arrays
Structure
Pointers
References in C++
Pointer to Structure
Functions
Parameter Passing
Methods
Array as Parameter
Structure as Parameter
Structures and Functions
Converting a C Program
to C++
Class and Constructor in
C++
We can perform more operations on the array data structure but the above are some basic operations. Let us
Template Classes in C++
give some information about the above functions-
Environment Setup for
Programming 1. Display () – To Display the entire array on the screen.
2. Add(n) / Append(n) – To add a particular element on the end of the array.
Setup Dev C++ and
3. Insert (index, n) – To add an element to a particular index.
Settings
4. Delete (index) – To delete an element with the help of an index in the given array.
Code Blocks IDE Setup 5. Search (n) – To check whether the given element is present or not in an array.
and Settings
6. Get (index) – It will return the element which presents on the given index.
7. Set (index, x) – It will change the element with the new element at a particular index.
Recursion
8. Max () / Min () – These will return the max and min element in the given array.
How does Recursion 9. Reverse () – It will reverse the order of elements in the given array.
works in C and C++? 10. Shift () – It will shift the whole elements either on the left or right side by the given number.
How Recursion Uses Stack
Time Complexity of Representation of Data on Array:
Recursive Function
Now let’s look at the representation of the data on an array.
Static and Global
Variables in Recursion
Tail Recursion
Head Recursion
Tree Recursion
Indirect Recursion
Nested Recursion
Sum of First N Natural
Number in C
Factorial of a Number in C The first thing is we need an array space of some size. Here we initialize an array of size = 10 and length = 0
Power of a number Using because there are no elements in the array.
Recursion in C
Taylor Series Using
Recursion in C
Taylor Series Using
Horner’s Rule
Combination Formula
using Recursion in C
Fibonacci Series using
Recursion in C
Here we have two methods to initialize our Array:
Tower Of Hanoi using
Recursion in C 1. Inside Stack Memory: As shown in the below image, A [10] will create a contiguous block of memory
index from 0 to 9 inside Stack.
Array – Representation
2. Inside Heap Memory: We can also create our array dynamically with the new keyword, The new
Array Declaration and operator denotes a request for memory allocation, as shown in the below image, we created a
Initialization pointer of int* type and in the next step we point it to a contiguous block of memory inside Heap. We
Static vs Dynamic Array in have created our array inside heap memory by using a pointer.
C/C++
How to increase the size
of an Array
2-D Arrays in C/C++
Array Representation by
Compiler