(club75)||Siz-education||Data structure and its importance in computer programming||by @christnenye

in Steem Infinity Zone7 months ago (edited)

Hello everyone, hope you all are doing well? Welcome back to my blog.

It will be very tedious and time consuming for the programmar to represent data just for it to be stored and used in a particular application but representing data for it to be stored and used over and over again in various applications which allows us to achieve a particular goal component re-using and time saving, that brings us to Data structure

Screenshot_20220301-004138.jpg
Source

Today I will be writing on data structure and it's importance.

INTRODUCTION

The word data means a facts that is represented which when processed becomes an information and structure means different pieces of data organized to form a unit.

Therefore, data structure is a way of representing these data in an organized way that considers not only the items stored but also the relationship of the items to each other. Of course, knowing how to organize data gives room for storing, retrieval of the data and knowing where the data is stored in memory.

Data has to be represented and classified to know the operations allowed for it and that brings us to;

CLASSIFICATION OF DATA STRUCTURES

Premitive data structure:The word premitive means related and in this data items are operated closest to the machine programming language (binary numbers; 0 and 1). The example include interger, character, double etc.

Non-premitive data structure: here, the data items are not close to machine programming language (binary numbers; 0 and 1). In this we have the common data structures that are linear like stacks, queues, lists, and arrays. The other non-linear data structure include graphs, trees and tables.

I will be explaining some of the common linear and non-linear data structure with the operations allowed for each for proper understanding;

STACK: This is a kind of data representation where successive data item are pushed down upon preceding data items in which the last item pushed in becomes the first item to pop out and vice versa.

Screenshot_20220301-082325_1.jpg
Source

Stacks are usually seen in arithmetic evaluation, infix to postfix transformation, stacks are useful in designing the compiler of operating system that stores local variable inside a function block and stacks are also used in decimal to binary conversion.

A typical example of where stack can be seen, since the name stack is derived from the fact that the memory is organized like a stack of plates in a cafeterian, where each operand(number) can be thought of as a plate, the first operand(plate) placed on stack is said to be at the bottom of the stack and the last operand(plate) placed are always at the top of the stack and the one that are only available as seen in the picture below

Screenshot_20220301-083103.jpg
Source

With the above picture I will be explaining the operations done on stacks.

Pushing: placing a plate in this case operand on the stack.
Popping: moving a plate in this case operand out of the stack.
Peek: searching for a plate in this case operand on the stack.

ARRAYS: This is a kind of data representation where variable (a memory location) can hold a fix number of items that are of the same type.

20220301_94013.jpg designed using pixel lab

Arrays are usually seen in database records that comprises of rows and columns and mathematical expression called Matrices using a two-dimensional matrices to illustrate the two operations done on Arrays

20220301_100038.jpg
source edited using pixel lab

Arrays is the only data structure that extracts the traditional arrangement of memory where two operations of storing and retrieving can be done.

Storing: because arrays are variable that hold fix value which is a memory location storing of number are done sequential adjacent to each other. Example with the diagram of a two dimensional matrix above values are stored by data[a][b][c][d]=X

Retrieving: retrieving a value from a two-dimensional matrix is done X=det[a][b][c][d].

TREES: the tree here is binary tree as computer understands only binary values , it's a kind of tree data representation in which no node can have more than two sub-tree. A node of a this binary tree is represented and arranged by a structure containing two pointers and a data part to other structures of the same data type.

Screenshot_20220301-112239.jpg
Source

The binary tree are usually applied for easy and quick access to data in Python, Java, C and C++ programming language, in which to access data of any position the root element is assign the "position i" = 0 and for any other positive interger, it can be accessed from the left node with the mathematical expression of (2i + 1) and from the right node (2i + 2). Using the below diagram to apply the principle;

20220301_115941.jpg designed using pixel lab

THE IMPORTANCE OF DATA STRUCTURE IN COMPUTER PROGRAMMING

  • It helps to efficiently develop well designed programs.

  • The main function of the program is to store and retrieve the user's data as fast as possible, hence data structures plays a relevant role in enhancing the performance of a program.

  • It helps to reduce the number of things the programmar has to keep in mind at any time.

  • It breaking down a complex task into a number of earlier sub tasks also simplifies testing and debugging.

  • It makes possible the decomposition of the complex task of developing a software system into a number of simpliar sub tasks

I am @christnenye, thank for reading.

Cc
@siz-official

Sort:  
 7 months ago 

Please add 10 % beneficiary rewards to siz-official.

Report,

SteemexclusiveYes
Bit BotNo
Club75Yes
PlagiarismNo
10 % to siz-officialYes

So sorry, I will always add it in my consecutive contents.

Loading...

Coin Marketplace

STEEM 0.22
TRX 0.06
JST 0.025
BTC 19145.98
ETH 1329.76
USDT 1.00
SBD 2.48