Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 14

DATA STRUCTURE

Data Definition
Data Definition defines a particular data with the following characteristics.

 Atomic − Definition should define a single concept.


 Traceable − Definition should be able to be mapped to some data element.
 Accurate − Definition should be unambiguous.
 Clear and Concise − Definition should be understandable.

Data Object
Data Object represents an object having a data.

Data Type
Data type is a way to classify various types of data such as integer, string, etc. which
determines the values that can be used with the corresponding type of data, the type of
operations that can be performed on the corresponding type of data. There are two data
types −

 Built-in Data Type


 Derived Data Type
Built-in Data Type
Those data types for which a language has built-in support are known as Built-in Data types.
For example, most of the languages provide the following built-in data types.

 Integers
 Boolean (true, false)
 Floating (Decimal numbers)
 Character and Strings
Derived Data Type
Those data types which are implementation independent as they can be implemented in
one or the other way are known as derived data types. These data types are normally built
by the combination of primary or built-in data types and associated operations on them. For
example −

 List-A list is any information displayed or organized in a logical or linear formation. 


 Array-
 Stack-A stack is a conceptual structure consisting of a set of homogeneous elements
and is based on the principle of last in first out (LIFO).
 Queue-A queue is an ordered collection of items where the addition of new items
happens at one end, called the “rear,” and the removal of existing items occurs at
the other end, commonly called the “front.” As an element enters the queue it starts
at the rear and makes its way toward the front, waiting until that time when it is the
next element to be removed.
Basic Operations
The data in the data structures are processed by certain operations. The particular data
structure chosen largely depends on the frequency of the operation that needs to be
performed on the data structure.

 Traversing-Traversing is an operation on the data structures. It is the process where


you access each and every element present in a data structure like an array or a
linked list or any data structure for that matter.
 Searching-Searching is a process of locating a particular element present in a given
set of elements.
 Insertion-
 Deletion-
 Sorting
Merging Array is a container which can hold a fix number of items and these items should
be of the same type. Most of the data structures make use of arrays to implement their
algorithms. Following are the important terms to understand the concept of Array.

 Element − Each item stored in an array is called an element.

 Index − Each location of an element in an array has a numerical index, which is used
to identify the element.

Array Representation
Arrays can be declared in various ways in different languages. For illustration, let's take C
array declaration.
Arrays can be declared in various ways in different languages. For illustration, let's take C
array declaration.

As per the above illustration, following are the important points to be considered.

 Index starts with 0.

 Array length is 10 which means it can store 10 elements.

 Each element can be accessed via its index. For example, we can fetch an element at
index 6 as 9.

Basic Operations
Following are the basic operations supported by an array.

 Traverse − print all the array elements one by one.


 Insertion − Adds an element at the given index.
 Deletion − Deletes an element at the given index.
 Search − Searches an element using the given index or by the value.
 Update − Updates an element at the given index.

In C, when an array is initialized with size, then it assigns defaults values to its elements in
following order.

Data Type Default Value

bool false

char 0
int 0

float 0.0

double 0.0f

void

wchar_t 0

Insertion Operation
Insert operation is to insert one or more data elements into an array. Based on the
requirement, a new element can be added at the beginning, end, or any given index of
array.

Here, we see a practical implementation of insertion operation, where we add data at the
end of the array −

Algorithm
Let Array be a linear unordered array of MAX elements.

Example
Result

Let LA be a Linear Array (unordered) with N elements and K is a positive integer such


that K<=N. Following is the algorithm where ITEM is inserted into the Kth position of LA –

Linear Array-one-dimensional array

1. Start
2. Set J = N
3. Set N = N+1
4. Repeat steps 5 and 6 while J >= K
5. Set LA[J+1] = LA[J]
6. Set J = J-1
7. Set LA[K] = ITEM
8. Stop

Example
Following is the implementation of the above algorithm −

#include <stdio.h>

main() {

int LA[] = {1,3,5,7,8};

int item = 10, k = 3, n = 5;

int i = 0, j = n;

printf("The original array elements are :\n");

for(i = 0; i<n; i++) {

printf("LA[%d] = %d \n", i, LA[i]);

n = n + 1;

while( j >= k) {

LA[j+1] = LA[j];

j = j - 1;

}
LA[k] = item;

printf("The array elements after insertion :\n");

for(i = 0; i<n; i++) {

printf("LA[%d] = %d \n", i, LA[i]);

When we compile and execute the above program, it produces the following result −

Output
The original array elements are :
LA[0] = 1
LA[1] = 3
LA[2] = 5
LA[3] = 7
LA[4] = 8
The array elements after insertion :
LA[0] = 1
LA[1] = 3
LA[2] = 5
LA[3] = 10
LA[4] = 7
LA[5] = 8

Deletion Operation
Deletion refers to removing an existing element from the array and re-organizing all
elements of an array.

Algorithm
Consider LA is a linear array with N elements nand K is a positive integer such that K<=N.
Following is the algorithm to delete an element available at the K th position of LA.

1. Start
2. Set J = K
3. Repeat steps 4 and 5 while J < N
4. Set LA[J] = LA[J + 1]
5. Set J = J+1
6. Set N = N-1
7. Stop

Example
Following is the implementation of the above algorithm −

#include <stdio.h>

void main() {

int LA[] = {1,3,5,7,8};

int k = 3, n = 5;

int i, j;

printf("The original array elements are :\n");

for(i = 0; i<n; i++) {

printf("LA[%d] = %d \n", i, LA[i]);

j = k;

while( j < n) {

LA[j-1] = LA[j];

j = j + 1;

n = n -1;
printf("The array elements after deletion :\n");

for(i = 0; i<n; i++) {

printf("LA[%d] = %d \n", i, LA[i]);

When we compile and execute the above program, it produces the following result −

Output
The original array elements are :
LA[0] = 1
LA[1] = 3
LA[2] = 5
LA[3] = 7
LA[4] = 8
The array elements after deletion :
LA[0] = 1
LA[1] = 3
LA[2] = 7
LA[3] = 8

Search Operation
You can perform a search for an array element based on its value or its index.

Algorithm
Consider LA is a linear array with N elements and K is a positive integer such that K<=N.
Following is the algorithm to find an element with a value of ITEM using sequential search.

1. Start
2. Set J = 0
3. Repeat steps 4 and 5 while J < N
4. IF LA[J] is equal ITEM THEN GOTO STEP 6
5. Set J = J +1
6. PRINT J, ITEM
7. Stop
Example
Following is the implementation of the above algorithm −

#include <stdio.h>

void main() {

int LA[] = {1,3,5,7,8};

int item = 5, n = 5;

int i = 0, j = 0;

printf("The original array elements are :\n");

for(i = 0; i<n; i++) {

printf("LA[%d] = %d \n", i, LA[i]);

while( j < n){

if( LA[j] == item ) {

break;

j = j + 1;

printf("Found element %d at position %d\n", item, j+1);

}
When we compile and execute the above program, it produces the following result −

Output
The original array elements are :
LA[0] = 1
LA[1] = 3
LA[2] = 5
LA[3] = 7
LA[4] = 8
Found element 5 at position 3

Update Operation
Update operation refers to updating an existing element from the array at a given index.

Algorithm
Consider LA is a linear array with N elements and K is a positive integer such that K<=N.
Following is the algorithm to update an element available at the K th position of LA.

1. Start
2. Set LA[K-1] = ITEM
3. Stop

Example
Following is the implementation of the above algorithm −

#include <stdio.h>

void main() {

int LA[] = {1,3,5,7,8};

int k = 3, n = 5, item = 10;

int i, j;

printf("The original array elements are :\n");

for(i = 0; i<n; i++) {


printf("LA[%d] = %d \n", i, LA[i]);

LA[k-1] = item;

printf("The array elements after updating :\n");

for(i = 0; i<n; i++) {

printf("LA[%d] = %d \n", i, LA[i]);

When we compile and execute the above program, it produces the following result −

Output
The original array elements are :
LA[0] = 1
LA[1] = 3
LA[2] = 5
LA[3] = 7
LA[4] = 8
The array elements after updating:
LA[0] = 1
LA[1] = 3
LA[2] = 10
LA[3] = 7
LA[4] = 8

The Seven Phases of the System-Development Life Cycle

The system-development life cycle enables users to transform a newly-developed project


into an operational one.
The System Development Life Cycle, "SDLC" for short, is a multistep, iterative process,
structured in a methodical way. This process is used to model or provide a framework for
technical and non-technical activities to deliver a quality system which meets or exceeds a
business"s expectations or manage decision-making progression.

Traditionally, the systems-development life cycle consisted of five stages. That has now
increased to seven phases. Increasing the number of steps helped systems analysts to define
clearer actions to achieve specific goals.

Similar to a project life cycle (PLC), the SDLC uses a systems approach to describe a process.
It is often used and followed when there is an IT or IS project under development.

The SDLC highlights different stages (phrases or steps) of the development process. The life
cycle approach is used so users can see and understand what activities are involved within a
given step. It is also used to let them know that at any time, steps can be repeated or a
previous step can be reworked when needing to modify or improve the system.

Following are the seven phases of the SDLC

1. Planning

This is the first phase in the systems development process. It identifies whether or not there
is the need for a new system to achieve a business"s strategic objectives. This is a
preliminary plan (or a feasibility study) for a company"s business initiative to acquire the
resources to build on an infrastructure to modify or improve a service. The company might
be trying to meet or exceed expectations for their employees, customers and stakeholders
too. The purpose of this step is to find out the scope of the problem and determine
solutions. Resources, costs, time, benefits and other items should be considered at this
stage.

2. Systems Analysis and Requirements

The second phase is where businesses will work on the source of their problem or the need
for a change. In the event of a problem, possible solutions are submitted and analyzed to
identify the best fit for the ultimate goal(s) of the project. This is where teams consider the
functional requirements of the project or solution. It is also where system analysis takes
place—or analyzing the needs of the end users to ensure the new system can meet their
expectations. Systems analysis is vital in determining what a business"s needs are, as well as
how they can be met, who will be responsible for individual pieces of the project, and what
sort of timeline should be expected.

There are several tools businesses can use that are specific to the second phase. They
include:

 CASE (Computer Aided Systems/Software Engineering)


 Requirements gathering
 Structured analysis

3. Systems Design

The third phase describes, in detail, the necessary specifications, features and operations
that will satisfy the functional requirements of the proposed system which will be in place.
This is the step for end users to discuss and determine their specific business information
needs for the proposed system. It"s during this phase that they will consider the essential
components (hardware and/or software) structure (networking capabilities), processing and
procedures for the system to accomplish its objectives.

4. Development

The fourth phase is when the real work begins—in particular, when a programmer, network
engineer and/or database developer are brought on to do the major work on the project.
This work includes using a flow chart to ensure that the process of the system is properly
organized. The development phase marks the end of the initial section of the process.
Additionally, this phase signifies the start of production. The development stage is also
characterized by instillation and change. Focusing on training can be a huge benefit during
this phase.

5. Integration and Testing

The fifth phase involves systems integration and system testing (of programs and
procedures)—normally carried out by a Quality Assurance (QA) professional—to determine
if the proposed design meets the initial set of business goals. Testing may be repeated,
specifically to check for errors, bugs and interoperability. This testing will be performed until
the end user finds it acceptable. Another part of this phase is verification and validation,
both of which will help ensure the program"s successful completion.
6. Implementation

The sixth phase is when the majority of the code for the program is written. Additionally,
this phase involves the actual installation of the newly-developed system. This step puts the
project into production by moving the data and components from the old system and
placing them in the new system via a direct cutover. While this can be a risky (and
complicated) move, the cutover typically happens during off-peak hours, thus minimizing
the risk. Both system analysts and end-users should now see the realization of the project
that has implemented changes.

7. Operations and Maintenance

The seventh and final phase involves maintenance and regular required updates. This step is
when end users can fine-tune the system, if they wish, to boost performance, add new
capabilities or meet additional user requirements.

Importance of the SDLC

If a business determines a change is needed during any phase of the SDLC, the company
might have to proceed through all the above life cycle phases again. The life cycle approach
of any project is a time-consuming process. Even though some steps are more difficult than
others, none are to be overlooked. An oversight could prevent the entire system from
functioning as planned.

Systems development specialists at Innovative Architects possess extensive experience in


managing these type of projects. If you have a situation at your organization and you think a
customized software solution may be what you need

You might also like