0% found this document useful (0 votes)
19 views22 pages

Data Structures Ecse

Uploaded by

Timothy Saxena
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views22 pages

Data Structures Ecse

Uploaded by

Timothy Saxena
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Types of Computer Languages

COMPUTER LANGUAGES
To write a program (tells what to do) for a computer, we must use a computer
language.
Over the years computer languages have evolved from machine languages to
natural languages.
1. Low Level Programming Language
a. Machine Language
b. Assembly Language or Symbolic Language
2. High Level Programming Language
The following is the summary of computer languages
1940‘s -- Machine Languages
1950‘s -- Symbolic Languages
1960‘s -- High Level Languages

Machine Language
In the earliest days of computers, the only programming languages available
were machine languages. Each computer has its own machine language which is
made of streams of 0’s and 1’s. The instructions in machine language must be in
streams of 0’s and 1’s. This is also referred as binary digits. These are so named as
the machine can directly understood the programs
Advantages:
1) High speed execution
2) The computer can understood instructions immediately
3) No translation is needed.
Disadvantages:
1) Machine dependent
2) Programming is very difficult
3) Difficult to understand
4) Difficult to write bug free programs
5) Difficult to isolate an error
Example: Additon of two numbers
20010
+30011
50101

Symbolic Languages (or) Assembly Language


In the early 1950‘s Admiral Grace Hopper, a mathematician and naval officer,
developed the concept of a special computer program that would convert programs
into machine language.
These early programming languages simply mirrored the machine languages
using symbols or mnemonics to represent the various language instructions. These
languages were known as symbolic languages.
Because a computer does not understand symbolic language it must be
translated into the machine language. A special program called an Assembler
translates symbolic code into the machine language. Hence they are called as
Assembly language.
Advantages:
1) Easy to understand and use
2) Easy to modify and isolate error
3) High efficiency
4) More control on hardware
Disadvantages:
1) Machine Dependent Language
2) Requires translator
3) Difficult to learn and write programs
4) Slow development time
5) Less efficient
Example:
2 PUSH 2,A
3 PUSH 3,B
+ ADD A,B
5 PRINT C

High-Level Languages
The symbolic languages greatly improved programming efficiency they still
required programmers to concentrate on the hardware that they were using working
withsymbolic languages was also very tedious because each machine instruction had
to beindividually coded. The desire to improve programmer efficiency and to change
the focus fromthe computer to the problems being solved led to the development of
high-level languages.
High-level languages are portable to many different computer allowing the
programmerto concentrate on the application problem at hand rather than the
intricacies of the computer.

Advantages:
1) Easy to write and understand
2) Easy to isolate an error
3) Machine independent language
4) Easy to maintain
5) Better readability
6) Low Development cost
7) Easier to document
8) Portable
Disadvantages:
1) Needs translator
2) Requires high execution time
3) Poor control on hardware
4) Less efficient
Difference between Machine, Assembly, High Level Languages
Language Translators
These are the programs which are used for converting the programs in one
language intomachine language instructions, so that they can be executed by the
computer.
1. Compiler: It is a program which is used to convert the high level language
programs into machine language
2. Assembler: It is a program which is used to convert the assembly level
language programs into machine language
3. Interpreter: It is a program, it takes one statement of a high level language
program, translates it into machine language instruction and then
immediately executes the resulting machine language instruction
and so on.
Comparison between a Compiler and Interpreter

Markup Languages:
A markup language is a computer language for clarifying the contents of a
document. It was designed to process, define, and present computer text in a form
that humans can read. It specifies the code used to format text, including the style and
layout the programmer wants the document to appear. It uses tags to define these
elements.
Some of the most commonly used markup languages are:
1. HyperText Markup Language(HTML): It is perhaps the most widely used
markup language today. It is mainly used to develop the web pages we see on
the World Wide Web. Essentially, every web page can be written using a
version of HTML. That makes the code critical in ensuring that the text and
images on a website follow proper formatting. Without it, browsers would have
no clue how the content should be displayed. HTML is also responsible for
giving web pages their basic structure. It is often used with Cascading
Style Sheets (CSS) to improve page appearance.
2. eXtensible Markup Language (XML): It is highly similar to HTML. It allows
browsers to display and interpret information correctly. But as its name implies,
XML is extensible. It permits a tag to define itself based on a given description
of the content rather than just display it.
Scripting Languages
Scripting languages are usually interpreted rather than compiled and are
often used for automating tasks, controlling software applications, and writing small
programs to automate repetitive tasks. They tend to be easier to learn and use
compared to traditional programming languages.

Scripting languages are a specific kind of computer languages that you


can use to give instructions to other software, such as a web browser, server, or
standalone application. Many of today’s most popular coding languages are scripting
languages, such as JavaScript, PHP, Ruby, Python, and several others.
As scripting languages make coding simpler and faster, it’s not surprising that
they are widely used in web development.

Characteristics of Scripting Language


 It is open-source, which means a user can have full control to view and edit it.
 It is easy to learn and work with.
 Comparatively faster to develop than an actual program.
 It has a limited number of data structures which makes it easy to write and edit.
 The language is beneficial to bring interactivity to web pages.
 It helps in creating new applications in web browsers.
 It is used to create plug-ins and extensions.

Types of Scripting Language


Scripting languages are classified into two types:
 Server-side scripting language: A web server is where server-side scripting
languages are executed. When a client submits an HTTP request, the server
responds by delivering content. One important advantage of server-side scripts
is that they are not visible to the general public, as client-side scripts are.
Examples: PHP, ASP.NET, Node.js, Java, Ruby, Perl, Python
 Client-side scripting language: This, on the other hand, executes on the
client’s end—in their web browser. Client-side scripts have the advantage of
reducing server demand, allowing web pages to load quicker.
Examples: HTML, CSS, JavaScript

Advantages:
 It is simple to switch between operating systems.
 Scripting language enhances the visual appeal of online sites.
 It is easy to learn and write in comparison with other languages.
 Scripts can be used as a software prototype, saving time on test projects.
 It assists in the insertion of visualisation interfaces and combinations into web
pages.
 Scripting languages are highly demanded for modern websites.
 To build improved websites, captivated visual descriptions such as background
and foreground colours, and so forth are required.
 No requirement to compile, although occasionally it is necessary.

Disdvantages:
 Some businesses do not want their scripts viewed by everyone, therefore they
employ server-side scripts to prevent revealing them to the public.
 Installing an interpretation programme might also be difficult.
 Scripts might be slower than programs at times.
Types of statements in algorithm.

The algorithm and flowchart include following three types of control structures.
1. Sequence: In the sequence structure, statements are placed one after the other
and the execution takes place starting from top to down.

2. Branching (Selection): In branch control, there is a condition and according to a


condition, a decision of either TRUE or FALSE is achieved. In the case of TRUE, one
of the two branches is explored; but in the case of FALSE condition, the other
alternative is taken. Generally, the ‘IF-THEN’ is used to represent branch control.

3. Loop (Repetition): The Loop or Repetition allows a statement(s) to be executed


repeatedly based on certain loop condition e.g. WHILE, FOR loops.

Characteristics of Algorithm:

Steps in Program Development

1. Problem Definition
2. Specification of Algorithm
3. Checking the correctness of algorithm
4. Analysis of Algorithm
5. Implementation of algorithm
6. Test the program

A data structure is a specialized format for organizing, processing, storing, and


retrieving data. It defines the relationship between data elements and the operations
that can be performed on them (for different programming languages).

In simple terms, data structure definition is- it is a collection of data values and the
relation between them, along with the functions or operations that can be applied to
the data.
Linear Data Structure

In a linear data structure, data elements follow a sequential order, where each element
possesses a distinct predecessor and successor. This structure operates on a single
level, facilitating the traversal of all elements in a singular pass. Implementing linear
data structures is comparatively uncomplicated due to the linear arrangement of
computer memory. Instances of linear data structures encompass arrays, stacks,
queues, and linked lists.

What is Non-Linear Data Structure?

A non-linear data structure is characterized by the absence of a sequential or linear


arrangement of its data elements. Instead, these elements are organized hierarchically
or in a structure resembling a tree. In a non-linear configuration, each element may
have one or more predecessors and successors, and there can be multiple paths to
access a particular element. Due to their intricate organization, it is not feasible to
traverse all the elements in a single pass.

Non-linear data structures are typically more difficult to implement than linear data
structures, but they can be more efficient in terms of memory usage. Examples of non-
linear data structures include trees, graphs, and heaps.

Linear Data Structures

Array:

An array is a data structure that contains a group of elements. Typically these elements
are all of the same data type, such as an integer or string. Arrays are commonly used
in computer programs to organize data so that a related set of values can be easily
sorted or searched.
Each element in an array has a number attached to it, called a numeric index, that
allows you to access it. Arrays start at index zero and can be manipulated with various
methods

Here is an image of what an array looks like:


Arrays can be classified into different types:

1. One-Dimensional Array: An Array with only one row of data elements is


known as a One-Dimensional Array. It is stored in ascending storage location.
2. Two-Dimensional Array: An Array consisting of multiple rows and columns of
data elements is called a Two-Dimensional Array. It is also known as a Matrix.
3. Multidimensional Array: We can define Multidimensional Array as an Array of
Arrays. Multidimensional Arrays are not bounded to two indices or two
dimensions as they can include as many indices are per the need.

Linked List:

Linked lists are linear collections of data very much like an array, but instead of the data
being arranged in one continuous block, each piece of data is linked to the next one in
the chain using pointers coupled with the data.

Here is an image of a linear list:


Linked Lists can be classified into different types:

1. Singly Linked List: A Singly Linked List is the most common type of Linked
List. Each node has data and a pointer field containing an address to the next
node.
2. Doubly Linked List: A Doubly Linked List consists of an information field and
two pointer fields. The information field contains the data. The first pointer field
contains an address of the previous node, whereas another pointer field
contains a reference to the next node. Thus, we can go in both directions
(backward as well as forward).
3. Circular Linked List: The Circular Linked List is similar to the Singly Linked
List. The only key difference is that the last node contains the address of the
first node, forming a circular loop in the Circular Linked List.

Stack:

A stack is also another type of data structure, which help organize data in a particular
order. A stack is a LIFO (Last in First Out) data structure. It is a simple data structure
that allows adding and removing elements in a particular order. Every time an element
is added, it goes on the top of the stack, the only element that can be removed is the
element that was at the top of the stack, just like a pile of objects.

Here is an image of a stack:


The primary operations in the Stack are as follows:

1. Push: Operation to insert a new element in the Stack is termed as Push


Operation.
2. Pop: Operation to remove or delete elements from the Stack is termed as Pop
Operation.

Queue

A queue is a type of data structure, which help organize data in a particular order. A
queue is a FIFO(First in First Out) data structure, which means that the element
inserted first will also be removed first.

Here is a image of a queue:


The following are the primary operations of the Queue:

1. Enqueue: The insertion or Addition of some data elements to the Queue is


called Enqueue. The element insertion is always done with the help of the rear
pointer.
2. Dequeue: Deleting or removing data elements from the Queue is termed
Dequeue. The deletion of the element is always done with the help of the front
pointer.

Non-Linear Data Structures

Tree

A tree is a data structure that is made up of a set of linked nodes, that can be used to
represent a hierarchical relationship among data elements. In other words how it is
connected by a series of references and has a root node.

Here is an image of a tree:


Trees can be classified into different types:

1. Binary Tree: A Tree data structure where each parent node can have at most
two children is termed a Binary Tree.
2. Binary Search Tree: A Binary Search Tree is a Tree data structure where we
can easily maintain a sorted list of numbers.
3. AVL Tree: An AVL Tree is a self-balancing Binary Search Tree where each
node maintains extra information known as a Balance Factor whose value is
either -1, 0, or +1.
4. B-Tree: A B-Tree is a special type of self-balancing Binary Search Tree where
each node consists of multiple keys and can have more than two children.

Graph

A graph is represented as a series of nodes and edges connecting those nodes. All
we need to understand is the relationship between a given node pair, and then we store
the edge connecting them. An edge is typically represented visually as a line and in
words as a pair of nodes.

Here is an image of a graph:


Hash Table

A hash table (also called a hash map, object or dictionary) is a data structure that pairs
keys to values. A hash table uses a hash function to compute an index into an array of
buckets or slots, from which the desired value can be found. The idea behind a hash
function is to distribute the entries (key/value pairs) across an array of buckets.

Here is an image of a hash table:


I also like to think of a hash table like an object such as this one:

Basic Operations of Data Structures


The different types of operations that we can perform to manipulate data in every data
structure:

1. Create: Create is an operation used to reserve memory for the data elements
of the program. We can perform this operation using a declaration statement.
The creation of data structure can take place either during the following:
1. Compile-time
2. Run-time
For example, the malloc() function is used in C Language to create data
structure.
2. Insertion: Insertion means inserting or adding new data elements to the
collection. For example, we can use the insertion operation to add the details
of a new employee the company has recently hired.
3. Deletion: Deletion means to remove or delete a specific data element from the
given list of data elements. For example, we can use the deleting operation to
delete the name of an employee who has left the job.
4. Traversal: Traversing a data structure means accessing each data element
exactly once so it can be administered. For example, traversing is required
while printing the names of all the employees in a department.
5. Search: Search is another data structure operation which means to find the
location of one or more data elements that meet certain constraints. Such a
data element may or may not be present in the given set of data elements. For
example, we can use the search operation to find the names of all the
employees who have the experience of more than 5 years.
6. Sorting: Sorting means to arrange the data elements in either Ascending or
Descending order depending on the type of application. For example, we can
use the sorting operation to arrange the names of employees in a department
in alphabetical order or estimate the top three performers of the month by
arranging the performance of the employees in descending order and extracting
the details of the top three.
7. Merge: Merge means to combine data elements of two sorted lists in order to
form a single list of sorted data elements.
8. Selection: Selection means selecting a particular data from the available data.
We can select any particular data by specifying conditions inside the loop.
9. Update: The Update operation allows us to update or modify the data in the
data structure. We can also update any particular data by specifying some
conditions inside the loop, like the Selection operation.
10. Splitting: The Splitting operation allows us to divide data into various subparts
decreasing the overall process completion time.

Software Development

Software Processes is a coherent set of activities for specifying, designing,


implementing and testing software systems.

Software Process and Software Development Lifecycle Model

One of the basic notions of the software development process is SDLC models
which stands for Software Development Life Cycle models. There are many
development life cycle models that have been developed in order to achieve
different required objectives. The models specify the various stages of the process
and the order in which they are carried out.

The most used, popular and important SDLC models are given below:

 Waterfall model
 V model
 Incremental model
 RAD model
 Agile model
 Iterative model
 Spiral model
 Prototype model

Waterfall Model

The waterfall model is a breakdown of project activities into linear sequential


phases, where each phase depends on the deliverables of the previous one and
corresponds to a specialisation of tasks. The approach is typical for certain areas
of engineering design.

Advantages of Waterfall Model

 It is very simple to understand and easy to use.


 Phases of waterfall model do not overlap with each other.
 It is useful for small projects in which requirements are clear at the
beginning.
 Since development is linear it is easy to manage development process.

Disadvantages of Waterfall Model

 It is not useful for large projects.


 Not suitable for projects in which requirement are not clear initially.
 Product is available only at the end of development process.
 It is very difficult to modify system requirement in the middle of development
process.

Agile Model

The agile model is an iterative, incremental software development approach


emphasizing flexibility and collaboration between cross-functional teams. It
consists of short, time-boxed iterations called sprints, where the team develops
and tests small project increments. Core values of this methodology include
incremental and continuous delivery, customer involvement, and change
responsiveness.

When to use the Agile Model?


• When Project size is large
• When frequent changes are required.
• When a highly qualified and experienced team is available.
• When a customer is ready to have a meeting with a software team all the
time.(every iteration)
• Projects with flexible timeline and budget.

The most widely used Agile methods include the following:


i. Scrum
ii. Extreme programming
iii. Dynamic systems development method
iv. Lean Software Development
v. Crystal
vi. Kanban
vii. Feature Driven Development

You might also like