0% found this document useful (0 votes)
5 views

1. [DStructure - Slides] Programming Methodologies

Uploaded by

alieslam20014
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

1. [DStructure - Slides] Programming Methodologies

Uploaded by

alieslam20014
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

Chapter 1

Programming
Methodologies
DATA STRUCTURES1:LECTURE
1
Introduction to Data Structures
ØA data structure is the structural representation of logical relationships between
elements of data. In other words, a data structure is a way of organizing data
items by considering its relationship to each other.
ØData structure mainly specifies the structured organization of data, by providing
accessing methods with correct degree of associativity. Data structure affects the
design of both the structural and functional aspects of a program.
ØAlgorithm + Data Structure = Program
ØData structures are the building blocks of a program; here the selection of a
particular data structure will help the programmer to design more efficient
programs as the complexity and volume of the problems solved by the computer is
steadily increasing day by day. The programmers have to strive hard to solve these
problems. If the problem is analyzed and divided into sub problems, the task will
be much easier i.e., divide, conquer and combine.
Stepwise Refinement is the process of breaking down a programming problem into a series of
steps. You start with a general set of steps to solve the problem, defining each in turn. Once you
have defined each of the steps you then break the problem down into a series of smaller sub-
steps. Once this is complete you keep on going until you have described the problem in such a
level of detail that you can code a solution to the problem.
The idea of "top down stepwise refinement" as a problem-solving technique. This can
help a person "think through" an algorithm by doing the following:
1. Start with the initial problem statement
2. Break it into a few general steps
3. Take each "step", and break it further into more detailed steps
4. Keep repeating the process on each "step", until you get a breakdown that is pretty
specific, and can be written more or less in pseudocode
5. Translate the pseudocode into real code
1.8. ANALYSIS OF ALGORITHM

The choice of a particular algorithm depends on following performance analysis


and measurements :
1. Space complexity
2. Time complexity
Time Complexity Definition
Time complexity is the amount of time taken by an algorithm to run, as a function of the length of the
input. It measures the time taken to execute each statement of code in an algorithm. Upskilling with the
help of an introduction to algorithms free course will help you understand time complexity clearly.

pace and Time define any physical object in the Universe. Similarly, Space and Time complexity can define
the effectiveness of an algorithm. While we know there is more than one way to solve the problem in
programming, knowing how the algorithm works efficiently can add value to the way we do programming.
To find the effectiveness of the program/algorithm, knowing how to evaluate them using Space and Time
complexity can make the program behave in required optimal conditions, and by doing so, it makes us
efficient programmers.
While we reserve the space to understand Space complexity for the future, let us focus on Time complexity
in this post. Time is Money! In this post, you will discover a gentle introduction to the Time complexity of
an algorithm, and how to evaluate a program based on Time complexity.
CLASSIFICATION OF DATA STRUCTURE

Data structure are normally divided into two broad


categories:
• Primitive Data Structure
• Non-Primitive Data Structure
ARRAYS
1. ONE DIMENSIONAL ARRAY
1. What is structured programming ? Explain
2. Distinguish between a program and an algorithm.
3. Explain the advantages and disadvantage of list structure over
array structure.

You might also like