Suche senden
Hochladen
Data Structure Basics
âą
12 gefÀllt mir
âą
1,457 views
Shakila Mahjabin
Folgen
CSC-391 course material. Data structure and algorithm basic.
Weniger lesen
Mehr lesen
Bildung
Technologie
Melden
Teilen
Melden
Teilen
1 von 24
Jetzt herunterladen
Downloaden Sie, um offline zu lesen
Empfohlen
Introduction to data structure
Introduction to data structure
Zaid Shabbir
Â
Basic Blocks and Flow Graphs
Basic Blocks and Flow Graphs
Jenny Galino
Â
Polish Notation In Data Structure
Polish Notation In Data Structure
Meghaj Mallick
Â
Code Optimization
Code Optimization
Akhil Kaushik
Â
Recognition-of-tokens
Recognition-of-tokens
Dattatray Gandhmal
Â
Specification-of-tokens
Specification-of-tokens
Dattatray Gandhmal
Â
Network lab manual
Network lab manual
Prabhu D
Â
A presentation on prim's and kruskal's algorithm
A presentation on prim's and kruskal's algorithm
Gaurav Kolekar
Â
Empfohlen
Introduction to data structure
Introduction to data structure
Zaid Shabbir
Â
Basic Blocks and Flow Graphs
Basic Blocks and Flow Graphs
Jenny Galino
Â
Polish Notation In Data Structure
Polish Notation In Data Structure
Meghaj Mallick
Â
Code Optimization
Code Optimization
Akhil Kaushik
Â
Recognition-of-tokens
Recognition-of-tokens
Dattatray Gandhmal
Â
Specification-of-tokens
Specification-of-tokens
Dattatray Gandhmal
Â
Network lab manual
Network lab manual
Prabhu D
Â
A presentation on prim's and kruskal's algorithm
A presentation on prim's and kruskal's algorithm
Gaurav Kolekar
Â
Issues in design_of_code_generator
Issues in design_of_code_generator
vinithapanneer
Â
Intermediate code generation in Compiler Design
Intermediate code generation in Compiler Design
Kuppusamy P
Â
Code generation
Code generation
Aparna Nayak
Â
CS8391 Data Structures Part B Questions Anna University
CS8391 Data Structures Part B Questions Anna University
P. Subathra Kishore, KAMARAJ College of Engineering and Technology, Madurai
Â
BCNF
BCNF
A. S. M. Shafi
Â
Data structure , stack , queue
Data structure , stack , queue
Rajkiran Nadar
Â
PostgreSQL - Case Study
PostgreSQL - Case Study
S.Shayan Daneshvar
Â
Abstraction in c++ and Real Life Example of Abstraction in C++
Abstraction in c++ and Real Life Example of Abstraction in C++
Hitesh Kumar
Â
Type Checking(Compiler Design) #ShareThisIfYouLike
Type Checking(Compiler Design) #ShareThisIfYouLike
United International University
Â
12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS
koolkampus
Â
6. Integrity and Security in DBMS
6. Integrity and Security in DBMS
koolkampus
Â
Input-Buffering
Input-Buffering
Dattatray Gandhmal
Â
CS8391 Data Structures 2 mark Questions - Anna University Questions
CS8391 Data Structures 2 mark Questions - Anna University Questions
P. Subathra Kishore, KAMARAJ College of Engineering and Technology, Madurai
Â
Object Based Databases
Object Based Databases
Farzad Nozarian
Â
Top Down Parsing, Predictive Parsing
Top Down Parsing, Predictive Parsing
Tanzeela_Hussain
Â
Unit iv(simple code generator)
Unit iv(simple code generator)
Kalaimathi Vijayakumar
Â
Dynamic Programming Code-Optimization Algorithm (Compiler Design)
Dynamic Programming Code-Optimization Algorithm (Compiler Design)
Dhrumil Panchal
Â
Graph representation
Graph representation
Tech_MX
Â
Collections and its types in C# (with examples)
Collections and its types in C# (with examples)
Aijaz Ali Abro
Â
Stack and Queue
Stack and Queue
Apurbo Datta
Â
Webpage Visual Design and Online Prototype
Webpage Visual Design and Online Prototype
amoore155
Â
Chapter 3.1
Chapter 3.1
sotlsoc
Â
Weitere Àhnliche Inhalte
Was ist angesagt?
Issues in design_of_code_generator
Issues in design_of_code_generator
vinithapanneer
Â
Intermediate code generation in Compiler Design
Intermediate code generation in Compiler Design
Kuppusamy P
Â
Code generation
Code generation
Aparna Nayak
Â
CS8391 Data Structures Part B Questions Anna University
CS8391 Data Structures Part B Questions Anna University
P. Subathra Kishore, KAMARAJ College of Engineering and Technology, Madurai
Â
BCNF
BCNF
A. S. M. Shafi
Â
Data structure , stack , queue
Data structure , stack , queue
Rajkiran Nadar
Â
PostgreSQL - Case Study
PostgreSQL - Case Study
S.Shayan Daneshvar
Â
Abstraction in c++ and Real Life Example of Abstraction in C++
Abstraction in c++ and Real Life Example of Abstraction in C++
Hitesh Kumar
Â
Type Checking(Compiler Design) #ShareThisIfYouLike
Type Checking(Compiler Design) #ShareThisIfYouLike
United International University
Â
12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS
koolkampus
Â
6. Integrity and Security in DBMS
6. Integrity and Security in DBMS
koolkampus
Â
Input-Buffering
Input-Buffering
Dattatray Gandhmal
Â
CS8391 Data Structures 2 mark Questions - Anna University Questions
CS8391 Data Structures 2 mark Questions - Anna University Questions
P. Subathra Kishore, KAMARAJ College of Engineering and Technology, Madurai
Â
Object Based Databases
Object Based Databases
Farzad Nozarian
Â
Top Down Parsing, Predictive Parsing
Top Down Parsing, Predictive Parsing
Tanzeela_Hussain
Â
Unit iv(simple code generator)
Unit iv(simple code generator)
Kalaimathi Vijayakumar
Â
Dynamic Programming Code-Optimization Algorithm (Compiler Design)
Dynamic Programming Code-Optimization Algorithm (Compiler Design)
Dhrumil Panchal
Â
Graph representation
Graph representation
Tech_MX
Â
Collections and its types in C# (with examples)
Collections and its types in C# (with examples)
Aijaz Ali Abro
Â
Stack and Queue
Stack and Queue
Apurbo Datta
Â
Was ist angesagt?
(20)
Issues in design_of_code_generator
Issues in design_of_code_generator
Â
Intermediate code generation in Compiler Design
Intermediate code generation in Compiler Design
Â
Code generation
Code generation
Â
CS8391 Data Structures Part B Questions Anna University
CS8391 Data Structures Part B Questions Anna University
Â
BCNF
BCNF
Â
Data structure , stack , queue
Data structure , stack , queue
Â
PostgreSQL - Case Study
PostgreSQL - Case Study
Â
Abstraction in c++ and Real Life Example of Abstraction in C++
Abstraction in c++ and Real Life Example of Abstraction in C++
Â
Type Checking(Compiler Design) #ShareThisIfYouLike
Type Checking(Compiler Design) #ShareThisIfYouLike
Â
12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS
Â
6. Integrity and Security in DBMS
6. Integrity and Security in DBMS
Â
Input-Buffering
Input-Buffering
Â
CS8391 Data Structures 2 mark Questions - Anna University Questions
CS8391 Data Structures 2 mark Questions - Anna University Questions
Â
Object Based Databases
Object Based Databases
Â
Top Down Parsing, Predictive Parsing
Top Down Parsing, Predictive Parsing
Â
Unit iv(simple code generator)
Unit iv(simple code generator)
Â
Dynamic Programming Code-Optimization Algorithm (Compiler Design)
Dynamic Programming Code-Optimization Algorithm (Compiler Design)
Â
Graph representation
Graph representation
Â
Collections and its types in C# (with examples)
Collections and its types in C# (with examples)
Â
Stack and Queue
Stack and Queue
Â
Andere mochten auch
Webpage Visual Design and Online Prototype
Webpage Visual Design and Online Prototype
amoore155
Â
Chapter 3.1
Chapter 3.1
sotlsoc
Â
Basics in algorithms and data structure
Basics in algorithms and data structure
Eman magdy
Â
Chapter 7.4
Chapter 7.4
sotlsoc
Â
Logic Formulation 2
Logic Formulation 2
deathful
Â
Chap 2(const var-datatype)
Chap 2(const var-datatype)
Bangabandhu Sheikh Mujibur Rahman Science and Technology University
Â
2. electric field calculation
2. electric field calculation
Bangabandhu Sheikh Mujibur Rahman Science and Technology University
Â
Digital Logic
Digital Logic
Dilum Bandara
Â
Problem Solving with Algorithms and Data Structure - Lists
Problem Solving with Algorithms and Data Structure - Lists
Yi-Lung Tsai
Â
Problem Solving with Algorithms and Data Structure - Graphs
Problem Solving with Algorithms and Data Structure - Graphs
Yi-Lung Tsai
Â
Komunikasyon
Komunikasyon
deathful
Â
Data Structure & Algorithms | Computer Science
Data Structure & Algorithms | Computer Science
Transweb Global Inc
Â
Data structures and algorithms
Data structures and algorithms
Julie Iskander
Â
áááááá Data Structure and Algorithm in C/C++
áááááá Data Structure and Algorithm in C/C++
Ngeam Soly
Â
Program logic formulation
Program logic formulation
Sara Corpuz
Â
Andere mochten auch
(15)
Webpage Visual Design and Online Prototype
Webpage Visual Design and Online Prototype
Â
Chapter 3.1
Chapter 3.1
Â
Basics in algorithms and data structure
Basics in algorithms and data structure
Â
Chapter 7.4
Chapter 7.4
Â
Logic Formulation 2
Logic Formulation 2
Â
Chap 2(const var-datatype)
Chap 2(const var-datatype)
Â
2. electric field calculation
2. electric field calculation
Â
Digital Logic
Digital Logic
Â
Problem Solving with Algorithms and Data Structure - Lists
Problem Solving with Algorithms and Data Structure - Lists
Â
Problem Solving with Algorithms and Data Structure - Graphs
Problem Solving with Algorithms and Data Structure - Graphs
Â
Komunikasyon
Komunikasyon
Â
Data Structure & Algorithms | Computer Science
Data Structure & Algorithms | Computer Science
Â
Data structures and algorithms
Data structures and algorithms
Â
áááááá Data Structure and Algorithm in C/C++
áááááá Data Structure and Algorithm in C/C++
Â
Program logic formulation
Program logic formulation
Â
Ăhnlich wie Data Structure Basics
2.02.Data_structures_and_algorithms (1).pptx
2.02.Data_structures_and_algorithms (1).pptx
DrBashirMSaad
Â
DS_PPT.ppt
DS_PPT.ppt
MeghaKulkarni27
Â
Data structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pd
Nimmi Weeraddana
Â
DATA STRUCTURES - SHORT NOTES
DATA STRUCTURES - SHORT NOTES
suthi
Â
Introduction to Data Structure.pptx
Introduction to Data Structure.pptx
GlenardDSarmiento
Â
UNITIII LDS.pdf
UNITIII LDS.pdf
meenamadhuvandhi2
Â
Introduction to data structure ppt
Introduction to data structure ppt
NalinNishant3
Â
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Axmedcarb
Â
Datastructures using c++
Datastructures using c++
Gopi Nath
Â
DS Module 1.pptx
DS Module 1.pptx
SaralaT3
Â
Introduction to Data Structures .
Introduction to Data Structures .
Ashutosh Satapathy
Â
DATA STRUCTURE IN C LANGUAGE
DATA STRUCTURE IN C LANGUAGE
shubhamrohiwal6
Â
DS Module 1.pptx
DS Module 1.pptx
sarala9
Â
Data structure (basics)
Data structure (basics)
ShrushtiGole
Â
Data Structures & Recursion-Introduction.pdf
Data Structures & Recursion-Introduction.pdf
MaryJacob24
Â
Data structure
Data structure
Gaurav Handge
Â
Data Structures and algoithms Unit - 1.pptx
Data Structures and algoithms Unit - 1.pptx
mexiuro901
Â
DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS
Adams Sidibe
Â
Introduction to Data Structure
Introduction to Data Structure
Jazz Jinia Bhowmik
Â
2. Introduction to Data Structure.pdf
2. Introduction to Data Structure.pdf
SulabhPawaia
Â
Ăhnlich wie Data Structure Basics
(20)
2.02.Data_structures_and_algorithms (1).pptx
2.02.Data_structures_and_algorithms (1).pptx
Â
DS_PPT.ppt
DS_PPT.ppt
Â
Data structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pd
Â
DATA STRUCTURES - SHORT NOTES
DATA STRUCTURES - SHORT NOTES
Â
Introduction to Data Structure.pptx
Introduction to Data Structure.pptx
Â
UNITIII LDS.pdf
UNITIII LDS.pdf
Â
Introduction to data structure ppt
Introduction to data structure ppt
Â
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Â
Datastructures using c++
Datastructures using c++
Â
DS Module 1.pptx
DS Module 1.pptx
Â
Introduction to Data Structures .
Introduction to Data Structures .
Â
DATA STRUCTURE IN C LANGUAGE
DATA STRUCTURE IN C LANGUAGE
Â
DS Module 1.pptx
DS Module 1.pptx
Â
Data structure (basics)
Data structure (basics)
Â
Data Structures & Recursion-Introduction.pdf
Data Structures & Recursion-Introduction.pdf
Â
Data structure
Data structure
Â
Data Structures and algoithms Unit - 1.pptx
Data Structures and algoithms Unit - 1.pptx
Â
DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS
Â
Introduction to Data Structure
Introduction to Data Structure
Â
2. Introduction to Data Structure.pdf
2. Introduction to Data Structure.pdf
Â
Mehr von Shakila Mahjabin
Computer processing
Computer processing
Shakila Mahjabin
Â
Arrays in CPP
Arrays in CPP
Shakila Mahjabin
Â
CSC 433 Sample normalization SQL Question
CSC 433 Sample normalization SQL Question
Shakila Mahjabin
Â
SQL : introduction
SQL : introduction
Shakila Mahjabin
Â
Normalization
Normalization
Shakila Mahjabin
Â
Solution of Erds
Solution of Erds
Shakila Mahjabin
Â
Entity Relationship Diagram
Entity Relationship Diagram
Shakila Mahjabin
Â
Ch1- Introduction to dbms
Ch1- Introduction to dbms
Shakila Mahjabin
Â
Stack and queue
Stack and queue
Shakila Mahjabin
Â
Algo analysis
Algo analysis
Shakila Mahjabin
Â
Merge sort and quick sort
Merge sort and quick sort
Shakila Mahjabin
Â
Codes on structures
Codes on structures
Shakila Mahjabin
Â
Arrays
Arrays
Shakila Mahjabin
Â
array, function, pointer, pattern matching
array, function, pointer, pattern matching
Shakila Mahjabin
Â
String operation
String operation
Shakila Mahjabin
Â
Mehr von Shakila Mahjabin
(15)
Computer processing
Computer processing
Â
Arrays in CPP
Arrays in CPP
Â
CSC 433 Sample normalization SQL Question
CSC 433 Sample normalization SQL Question
Â
SQL : introduction
SQL : introduction
Â
Normalization
Normalization
Â
Solution of Erds
Solution of Erds
Â
Entity Relationship Diagram
Entity Relationship Diagram
Â
Ch1- Introduction to dbms
Ch1- Introduction to dbms
Â
Stack and queue
Stack and queue
Â
Algo analysis
Algo analysis
Â
Merge sort and quick sort
Merge sort and quick sort
Â
Codes on structures
Codes on structures
Â
Arrays
Arrays
Â
array, function, pointer, pattern matching
array, function, pointer, pattern matching
Â
String operation
String operation
Â
KĂŒrzlich hochgeladen
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
EduSkills OECD
Â
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
VS Mahajan Coaching Centre
Â
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
Steve Thomason
Â
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
misteraugie
Â
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Sapana Sha
Â
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
eniolaolutunde
Â
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
chloefrazer622
Â
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
anjaliyadav012327
Â
mini mental status format.docx
mini mental status format.docx
PoojaSen20
Â
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
SoniaTolstoy
Â
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
Jayanti Pande
Â
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
SafetyChain Software
Â
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
Shobhayan Kirtania
Â
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
Thiyagu K
Â
microwave assisted reaction. General introduction
microwave assisted reaction. General introduction
Maksud Ahmed
Â
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
fonyou31
Â
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
Chameera Dedduwage
Â
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
FatimaKhan178732
Â
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 đ Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 đ Full Nigh...
Pooja Nehwal
Â
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
sanyamsingh5019
Â
KĂŒrzlich hochgeladen
(20)
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Â
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Â
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
Â
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
Â
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Â
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
Â
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
Â
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
Â
mini mental status format.docx
mini mental status format.docx
Â
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
Â
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
Â
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
Â
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
Â
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
Â
microwave assisted reaction. General introduction
microwave assisted reaction. General introduction
Â
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Â
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
Â
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
Â
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 đ Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 đ Full Nigh...
Â
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
Â
Data Structure Basics
1.
Data Structures and Algorithms Lec-1 CSC
391
2.
2 Data Structures and
Algorithms Data Structure ©SMT, Faculty, CSE, IUBAT In computer science, a data structure is a particular way of storing and organizing data in a computerâs memory so that it can be used efficiently. Data may be organized in many different ways. The logical or mathematical model of a particular organization of data is called a data structure.
3.
3 Data Structures and
Algorithms Types Categories of Data Structure: The data structure can be classified in to major types: ⹠Linear Data Structure ⹠Non-linear Data Structure 1. Linear Data Structure: A data structure is said to be linear if its elements form any sequence. There are basically two ways of representing such linear structure in memory. a) One way is to have the linear relationships between the elements represented by means of sequential memory location. These linear structures are called arrays. b) The other way is to have the linear relationship between the elements represented by means of pointers or links. These linear structures are called linked lists. ©SMT, Faculty, CSE, IUBAT
4.
4 Data Structures and
Algorithms The common examples of linear data structure are- Arrays, Queues, Stacks, Linked lists 2. Non-linear Data Structure: This structure is mainly used to represent data containing a hierarchical relationship between elements. e.g. graphs, family trees and table of contents. Types ©SMT, Faculty, CSE, IUBAT
5.
5 Data Structures and
Algorithms Memory Allocation ©SMT, Faculty, CSE, IUBAT Memory allocation can be classified as either ï€ Contiguous ï€ Linked ï€ Indexed Prototypical examples: ï€ Contiguous allocation: arrays ï€ Linked allocation: linked lists
6.
6 Data Structures and
Algorithms Contiguous Allocation ©SMT, Faculty, CSE, IUBAT An array stores n objects in a single contiguous space of memory Unfortunately, if more memory is required, a request for new memory usually requires copying all information into the new memory ï€ In general, you cannot request for the operating system to allocate to you the next n memory locations
7.
7 Data Structures and
Algorithms Linked Allocation ©SMT, Faculty, CSE, IUBAT Linked storage such as a linked list associates two pieces of data with each item being stored: ï€ The object itself, and ï€ A reference to the next item ïź In C++ that reference is the address of the next node
8.
8 Data Structures and
Algorithms Linked Allocation ©SMT, Faculty, CSE, IUBAT This is a class describing such a node template <typename Type> class Node { private: Type element; Node *next_node; public: // ... };
9.
9 Data Structures and
Algorithms Linked Allocation ©SMT, Faculty, CSE, IUBAT The operations on this node must include: ï€ Constructing a new node ï€ Accessing (retrieving) the value ï€ Accessing the next pointer Node( const Type& = Type(), Node* = nullptr ); Type retrieve() const; Node *next() const; Pointing to nothing has been represented as: C NULL Java/C# null C++ (old) 0 C++ (new) nullptr Symbolically Ă
10.
10 Data Structures and
Algorithms Linked Allocation ©SMT, Faculty, CSE, IUBAT For a linked list, however, we also require an object which links to the first object The actual linked list class must store two pointers ï€ A head and tail: Node *head; Node *tail; Optionally, we can also keep a count int count; The next_node of the last node is assigned nullptr
11.
11 Data Structures and
Algorithms Linked Allocation ©SMT, Faculty, CSE, IUBAT The class structure would be: template <typename Type> class List { private: Node<Type> *head; Node<Type> *tail; int count; public: // constructor(s)... // accessor(s)... // mutator(s)... };
12.
12 Data Structures and
Algorithms Indexed Allocation ©SMT, Faculty, CSE, IUBAT With indexed allocation, an array of pointers (possibly NULL) link to a sequence of allocated memory locations Used in the C++ standard template library Computer engineering students will see indexed allocation in their operating systems course
13.
13 Data Structures and
Algorithms Indexed Allocation ©SMT, Faculty, CSE, IUBAT Matrices can be implemented using indexed allocation: 1 2 3 4 5 6 ïŠ ï¶ ï§ ï· ïš ïž
14.
14 Data Structures and
Algorithms Indexed Allocation ©SMT, Faculty, CSE, IUBAT Matrices can be implemented using indexed allocation ï€ Most implementations of matrices (or higher-dimensional arrays) use indices pointing into a single contiguous block of memory Row-major order Column-major order C, Python Matlab, Fortran 1 2 3 4 5 6 ïŠ ï¶ ï§ ï· ïš ïž
15.
15 Data Structures and
Algorithms Data Structure Formats ©SMT, Faculty, CSE, IUBAT We will look at some variations or hybrids of these memory allocations including: ï€ Trees ï€ Graphs ï€ Array ï€ Linked List ï€ Stack ï€ Queue
16.
16 Data Structures and
Algorithms Trees ©SMT, Faculty, CSE, IUBAT The linked list can be used to store linearly ordered data ï€ What if we have multiple next pointers? A rooted tree (weeks 4-6) is similar to a linked list but with multiple next pointers
17.
17 Data Structures and
Algorithms Trees ©SMT, Faculty, CSE, IUBAT Data frequently contain a hierarchical relationship between various elements. The data structure which reflects this relationship is called a rooted tree graph or, simply, a tree. A tree is a variation on a linked list: ï€ Each node points to an arbitrary number of subsequent nodes ï€ Useful for storing hierarchical data 2.2.2.2
18.
18 Data Structures and
Algorithms Graphs ©SMT, Faculty, CSE, IUBAT Suppose we allow arbitrary relations between any two objects in a container ï€ Given n objects, there are n2 â n possible relations ïź If we allow symmetry, this reduces to ï€ For example, consider the network 2 2 n nï 2.2.2.2 Data sometimes contains a relationship between pairs of elements which is not necessarily hierarchical in nature, e.g. an airline flights only between the cities connected by lines. This data structure is called Graph.
19.
19 Data Structures and
Algorithms Arrays ©SMT, Faculty, CSE, IUBAT 2.2.2.2 The simplest type of data structure is a linear (or one dimensional) array. A list of a finite number n of similar data referenced respectively by a set of n consecutive numbers, usually 1, 2, 3 . . . . . . . n. if we choose the name A for the array, then the elements of A are denoted by subscript notation A 1 , A 2 , A 3 . . . . A n or by the parenthesis notation A (1), A (2), A (3) . . . . . . A (n) or by the bracket notation A [1], A [2], A [3] . . . . . . A [n] Example: A linear array A[8] consisting of numbers is pictured in following figure
20.
20 Data Structures and
Algorithms Linked List ©SMT, Faculty, CSE, IUBAT A linked list, or one way list is a linear collection of data elements, called nodes, where the linear order is given by means of pointers. Each node is divided into two parts: ïThe first part contains the information of the element/node ïThe second part contains the address of the next node (link /next pointer field) in the list. There is a special pointer Start/List contains the address of first node in the list. If this special pointer contains null, means that List is empty.
21.
21 Data Structures and
Algorithms Array of Linked Lists ©SMT, Faculty, CSE, IUBAT Suppose we allow arbitrary relations between any two objects in a container ï€ Alternatively, we could use a hybrid: an array of linked lists A B C D E F G H I J K L 2.2.2.2
22.
22 Data Structures and
Algorithms Queue and Stack ©SMT, Faculty, CSE, IUBAT Queue: A queue, also called FIFO system, is a linear list in which deletions can take place only at one end of the list, the Font of the list and insertion can take place only at the other end Rear. Stack: It is an ordered group of homogeneous items of elements. Elements are added to and removed from the top of the stack (the most recently added items are at the top of the stack). The last element to be added is the first to be removed (LIFO: Last In, First Out).
23.
23 Data Structures and
Algorithms Data Structures Operations ©SMT, Faculty, CSE, IUBAT The data appearing in our data structures are processed by means of certain operations. In fact, the particular data structure that one chooses for a given situation depends largely in the frequency with which specific operations are performed. The following four operations play a major role in this text: ï¶ Traversing: accessing each record/node exactly once so that certain items in the record may be processed. (This accessing and processing is sometimes called âvisitingâ the record.)
24.
24 Data Structures and
Algorithms Data Structures Operations ©SMT, Faculty, CSE, IUBAT ï¶ Searching: Finding the location of the desired node with a given key value, or finding the locations of all such nodes which satisfy one or more conditions. ï¶ Inserting: Adding a new node/record to the structure. ï¶ Deleting: Removing a node/record from the structure.
Jetzt herunterladen