Chapter 1 Introduction to Data Structures and Algorithms.pdfAxmedcarb
Data structures provide an efficient way to store and organize data in a computer so that it can be used efficiently. They allow programmers to handle data in an enhanced way, improving software performance. There are linear data structures like arrays and linked lists, and non-linear structures like trees and graphs. Common operations on data structures include insertion, deletion, searching, sorting, and merging. Asymptotic analysis is used to define the time complexity of algorithms in the average, best, and worst cases.
The document discusses key concepts related to data structures and algorithms. It defines data as values or sets of values that can be organized hierarchically into fields, records, and files. Entities have attributes that can be assigned values. Related entities form entity sets. Data structures organize data through fields, records, and files while supporting operations like searching, insertion, and deletion. Algorithms are step-by-step processes to solve problems in a finite number of steps. The efficiency of algorithms is measured by time and space complexity.
The document discusses algorithms and data structures. It begins by introducing common data structures like arrays, stacks, queues, trees, and hash tables. It then explains that data structures allow for organizing data in a way that can be efficiently processed and accessed. The document concludes by stating that the choice of data structure depends on effectively representing real-world relationships while allowing simple processing of the data.
This document outlines the syllabus for Computer Science (41) taught by Prof. K. Adisesha. It covers 4 units: Unit A discusses computer hardware components and data structures; Unit B covers object-oriented programming in C++; Unit C focuses on databases, queries, and large data; Unit D examines advanced communication technology concepts like networking and web design. Key topics include motherboards, Boolean algebra, arrays, stacks, queues, classes, inheritance, pointers, files, SQL, networks, and HTML.
The document provides biographical and professional details about Engr. Dr. Sohaib Manzoor. It lists his educational qualifications including a BS in electrical engineering, an MS in electrical and electronics engineering, and a PhD in information and communication engineering. It also outlines his work experience as a lecturer at Mirpur University of Science and Technology, Pakistan. Additionally, it lists his skills, contact information, hobbies and some academic and non-academic achievements.
Data structures and algorithms short note (version 14).pdNimmi Weeraddana
The document provides an introduction to data structures and algorithms. It discusses why data structures are needed, common measurements of efficiency, and the costs of algorithms. It defines abstract and concrete data structures, and provides examples of stacks and queues as abstract data types that can be implemented using concrete data structures like arrays. It also discusses algorithms for operations like sorting, searching, insertion and removal. Overall, the document serves as an introductory overview of key concepts in data structures and algorithms.
This document outlines a course on programming and data structures in C. It discusses key concepts like abstract data types, asymptotic analysis, various data structures like arrays, stacks, queues, linked lists, trees, and graphs. It covers different algorithms for searching, sorting and indexing of data. The objectives are to learn a program-independent view of data structures and their usage in algorithms. Various data structures, their representations and associated operations are explained. Methods for analyzing algorithms to determine their time and space complexity are also presented.
This document provides an introduction to data structures. It discusses primitive and non-primitive data structures and their classifications. Linear data structures like arrays, stacks, queues and linked lists are covered, along with non-linear structures like trees and graphs. Common operations on data structures like traversing, searching, inserting and deleting are also summarized. Finally, the document introduces abstract data types and provides examples of common ADT specifications for lists, stacks and queues.
This document provides an overview of a 16-week course on data structures and algorithms. It includes the following key points:
- The course covers a range of data structures (e.g. arrays, linked lists, trees) and algorithms (e.g. sorting, searching).
- Assessment is based on assignments, quizzes, midterm, and final exam.
- Each week covers a different data structure or algorithm topic, such as arrays, linked lists, sorting, trees, graphs, and shortest paths.
- The course learning objectives are to understand fundamental data structures, analyze time/space complexities, and select appropriate algorithms for applications.
This document provides an introduction to data structures. It discusses primitive and non-primitive data structures and their classifications. Linear data structures like arrays, stacks, queues and linked lists are covered, along with non-linear structures like trees and graphs. Common operations on data structures are also summarized such as traversing, searching, inserting and deleting. Finally, abstract data types and examples of common ADTs like lists, stacks and queues are introduced.
The document introduces data structures and algorithms. It discusses that data structures include arrays, linked lists, stacks, queues, trees and graphs which can be used to organize data efficiently. It also explains that algorithms use these data structures to solve problems. The choice of data structure impacts an algorithm's time and space efficiency. Common operations on data structures like traversal, search, insertion and deletion are also introduced. Examples of different data structures and algorithms like linear search, binary search and hashing are provided to illustrate time-space tradeoffs.
The document discusses data structures and algorithms. It defines data structures and different types including primitive and non-primitive structures. It describes operations on data structures like traversing, searching, insertion and deletion. It also defines concepts like abstract data types, asymptotic analysis, and different algorithm analysis methods. Examples provided include linear search algorithm and binary search algorithm in pseudocode and C code.
This document provides an overview of an introductory course on algorithms and data structures. It discusses key topics that will be covered including introduction to algorithms, complexity analysis, algorithm design strategies like divide and conquer, and data structures. Specific examples of algorithms and data structures are provided like sorting, searching, linked lists, stacks, queues, trees and graphs. Implementation tools for algorithms like pseudo code and flowcharts are also introduced.
This document discusses data structures and algorithms. It provides grading schemes for theory and lab components. It acknowledges reference sources used to prepare the lecture. Key points covered include: what data structures are and why they are important for organizing data efficiently; characteristics of good data structures like time and space complexity; definitions of algorithms and examples like searching and sorting; and algorithmic notations used to describe processes like linear and binary search of arrays.
This document provides an introduction to data structures and algorithms. It discusses why they are important for programming and problem solving. It defines key concepts like abstract data types, data structures, algorithms, and algorithm analysis. It also covers different ways of classifying data structures and analyzing the time and space complexity of algorithms. The goal is to help students understand fundamental concepts around organizing data and designing efficient computational procedures.
This document describes a course on data structures and algorithms. The course covers fundamental algorithms like sorting and searching as well as data structures including arrays, linked lists, stacks, queues, trees, and graphs. Students will learn to analyze algorithms for efficiency, apply techniques like recursion and induction, and complete programming assignments implementing various data structures and algorithms. The course aims to enhance students' skills in algorithm design, implementation, and complexity analysis. It is worth 4 credits and has prerequisites in computer programming. Student work will be graded based on assignments, exams, attendance, and a final exam.
This document discusses the importance of algorithms and data structures in computer science. It covers common topics in the study of algorithms and data structures including data types, collections, data structures, algorithms, and choosing appropriate data structures and algorithms to solve problems. Key areas covered include linear data structures, trees, graphs, algorithm classification, common algorithm design strategies, and classic algorithms.
In computer science, a data structure is a data organization, management, and storage format that enables efficient access and modification. More precisely, a data structure is a collection of data values, the relationships among them, and the functions or operations that can be applied to the data. https://apkleet.com
<a href="https://apkleet.com" >games apk </a>
The document provides an overview of the syllabus for a Data Structures course. It discusses topics that will be covered including arrays, linked lists, stacks, queues, trees, and graphs. It also outlines the course grading breakdown and covers basic terminology related to data structures such as data, data items, records, and files. Common data structure operations like traversing, searching, inserting, and deleting are also defined. Lastly, it provides guidance on selecting appropriate data structures based on the problem constraints and required operations.
Data structures and algorithms short note (version 14).pdNimmi Weeraddana
The document provides an introduction to data structures and algorithms. It discusses why data structures are needed, common measurements of efficiency, and the costs of algorithms. It defines abstract and concrete data structures, and provides examples of stacks and queues as abstract data types that can be implemented using concrete data structures like arrays. It also discusses algorithms for operations like sorting, searching, insertion and removal. Overall, the document serves as an introductory overview of key concepts in data structures and algorithms.
This document outlines a course on programming and data structures in C. It discusses key concepts like abstract data types, asymptotic analysis, various data structures like arrays, stacks, queues, linked lists, trees, and graphs. It covers different algorithms for searching, sorting and indexing of data. The objectives are to learn a program-independent view of data structures and their usage in algorithms. Various data structures, their representations and associated operations are explained. Methods for analyzing algorithms to determine their time and space complexity are also presented.
This document provides an introduction to data structures. It discusses primitive and non-primitive data structures and their classifications. Linear data structures like arrays, stacks, queues and linked lists are covered, along with non-linear structures like trees and graphs. Common operations on data structures like traversing, searching, inserting and deleting are also summarized. Finally, the document introduces abstract data types and provides examples of common ADT specifications for lists, stacks and queues.
This document provides an overview of a 16-week course on data structures and algorithms. It includes the following key points:
- The course covers a range of data structures (e.g. arrays, linked lists, trees) and algorithms (e.g. sorting, searching).
- Assessment is based on assignments, quizzes, midterm, and final exam.
- Each week covers a different data structure or algorithm topic, such as arrays, linked lists, sorting, trees, graphs, and shortest paths.
- The course learning objectives are to understand fundamental data structures, analyze time/space complexities, and select appropriate algorithms for applications.
This document provides an introduction to data structures. It discusses primitive and non-primitive data structures and their classifications. Linear data structures like arrays, stacks, queues and linked lists are covered, along with non-linear structures like trees and graphs. Common operations on data structures are also summarized such as traversing, searching, inserting and deleting. Finally, abstract data types and examples of common ADTs like lists, stacks and queues are introduced.
The document introduces data structures and algorithms. It discusses that data structures include arrays, linked lists, stacks, queues, trees and graphs which can be used to organize data efficiently. It also explains that algorithms use these data structures to solve problems. The choice of data structure impacts an algorithm's time and space efficiency. Common operations on data structures like traversal, search, insertion and deletion are also introduced. Examples of different data structures and algorithms like linear search, binary search and hashing are provided to illustrate time-space tradeoffs.
The document discusses data structures and algorithms. It defines data structures and different types including primitive and non-primitive structures. It describes operations on data structures like traversing, searching, insertion and deletion. It also defines concepts like abstract data types, asymptotic analysis, and different algorithm analysis methods. Examples provided include linear search algorithm and binary search algorithm in pseudocode and C code.
This document provides an overview of an introductory course on algorithms and data structures. It discusses key topics that will be covered including introduction to algorithms, complexity analysis, algorithm design strategies like divide and conquer, and data structures. Specific examples of algorithms and data structures are provided like sorting, searching, linked lists, stacks, queues, trees and graphs. Implementation tools for algorithms like pseudo code and flowcharts are also introduced.
This document discusses data structures and algorithms. It provides grading schemes for theory and lab components. It acknowledges reference sources used to prepare the lecture. Key points covered include: what data structures are and why they are important for organizing data efficiently; characteristics of good data structures like time and space complexity; definitions of algorithms and examples like searching and sorting; and algorithmic notations used to describe processes like linear and binary search of arrays.
This document provides an introduction to data structures and algorithms. It discusses why they are important for programming and problem solving. It defines key concepts like abstract data types, data structures, algorithms, and algorithm analysis. It also covers different ways of classifying data structures and analyzing the time and space complexity of algorithms. The goal is to help students understand fundamental concepts around organizing data and designing efficient computational procedures.
This document describes a course on data structures and algorithms. The course covers fundamental algorithms like sorting and searching as well as data structures including arrays, linked lists, stacks, queues, trees, and graphs. Students will learn to analyze algorithms for efficiency, apply techniques like recursion and induction, and complete programming assignments implementing various data structures and algorithms. The course aims to enhance students' skills in algorithm design, implementation, and complexity analysis. It is worth 4 credits and has prerequisites in computer programming. Student work will be graded based on assignments, exams, attendance, and a final exam.
This document discusses the importance of algorithms and data structures in computer science. It covers common topics in the study of algorithms and data structures including data types, collections, data structures, algorithms, and choosing appropriate data structures and algorithms to solve problems. Key areas covered include linear data structures, trees, graphs, algorithm classification, common algorithm design strategies, and classic algorithms.
In computer science, a data structure is a data organization, management, and storage format that enables efficient access and modification. More precisely, a data structure is a collection of data values, the relationships among them, and the functions or operations that can be applied to the data. https://apkleet.com
<a href="https://apkleet.com" >games apk </a>
The document provides an overview of the syllabus for a Data Structures course. It discusses topics that will be covered including arrays, linked lists, stacks, queues, trees, and graphs. It also outlines the course grading breakdown and covers basic terminology related to data structures such as data, data items, records, and files. Common data structure operations like traversing, searching, inserting, and deleting are also defined. Lastly, it provides guidance on selecting appropriate data structures based on the problem constraints and required operations.
This document provides an overview of key concepts in English grammar, including sentences, parts of speech, punctuation, and the structure of sentences. It begins by defining what a sentence is and explaining that sentences contain subjects, verbs, and sometimes objects. It then describes the main parts of speech - nouns, pronouns, adjectives, verbs, adverbs - and supporting parts of speech like articles, conjunctions, prepositions, and interjections. Various punctuation marks and their uses are outlined. The document concludes by explaining the key parts of a sentence including the subject, verb, direct object, and indirect object.
This document provides a summary of lecture 3 on functional English. It discusses the formation of words through morphology and the different types of morphemes. It also explains prefixes, suffixes, and infixes as types of affixes. The document defines key terms like dictionary, clauses, active and passive voice, and different types of sentences. It provides examples of simple, compound and complex sentences. Overall, the document covers word formation, grammar rules, and sentence structure in the English language.
Brandon Flatley masterfully blends creativity and community impact. As a mixologist and small business owner, he delivers unforgettable cocktail experiences. A musician at heart, he excels in composition and recording.
Olga Baranets: AI Doesn’t Wait for Retros (UA)
UA Online PMDay 2025 Spring
Website – https://pmday.org/online
Youtube – https://www.youtube.com/startuplviv
FB – https://www.facebook.com/pmdayconference
Petslify Turns Pet Photos into Hug-Worthy MemoriesPetslify
Petslify transforms your pet’s photo into a custom plush that captures every detail. Customers love the lifelike result, making it feel like their furry friend is still with them—soft, cuddly, and full of love.
The Institute for Public Relations Behavioral Insights Research Center and Leger partnered on this 5th edition of the Disinformation in Society Report. We surveyed 2,000 U.S. adults to assess what sources they trust, how Americans perceive false or misleading information, who they hold responsible for spreading it, and what actions they believe are necessary to combat it.
The Peter Cowley Entrepreneurship Event Master 30th.pdfRichard Lucas
About this event
The event is dedicated to remember the contribution Peter Cowley made to the entrepreneurship eco-system in Cambridge and beyond, and includes a special lecture about his impact..
We aim to make the event useful and enjoyable for all those who are committed to entrepreneurship.
Programme
Registration and Networking
Introduction & Welcome
The Invested Investor Peter Cowley Entrepreneurship Talk, by Katy Tuncer Linkedin
Introductions from key actors in the entrepreneurship support eco-system
Cambridge Angels Emmi Nicholl Managing Director Linkedin
Cambridge University Entrepreneurs , Emre Isik President Elect Linkedin
CUTEC Annur Ababil VP Outreach Linkedin
King's Entrepreneurship Lab (E-Lab) Sophie Harbour Linkedin
Cambridgeshire Chambers of Commerce Charlotte Horobin CEO Linkedin
St John's Innovation Centre Ltd Barnaby Perks CEO Linkedin
Presentations by entrepreneurs from Cambridge and Anglia Ruskin Universities
Jeremy Leong Founder Rainbow Rocket Climbing Wall Linkedin
Mark Kotter Founder - bit.bio https://www.bit.bio Linkedin
Talha Mehmood Founder CEO Medily Linkedin
Alison Howie Cambridge Adaptive Testing Linkedin
Mohammad Najilah, Director of the Medical Technology Research Centre, Anglia Ruskin University Linkedin
Q&A
Guided Networking
Light refreshments will be served. Many thanks to Penningtons Manches Cooper and Anglia Ruskin University for covering the cost of catering, and to Anglia Ruskin University for providing the venue
The event is hosted by
Prof. Gary Packham Linkedin Pro Vice Chancellor Anglia Ruskin University
Richard Lucas Linkedin Founder CAMentrepreneurs
About Peter Cowley
Peter Cowley ARU Doctor of Business Administration, honoris causa.
Author of Public Success Private Grief
Co-Founder CAMentrepreneurs & Honorary Doctorate from Anglia Ruskin.
Chair of Cambridge Angels, UK Angel Investor of the Year, President of European Business Angels Network Wikipedia. Peter died in November 2024.
About Anglia Ruskin University - ARU
ARU was the recipient of the Times Higher Education University of the Year 2023 and is a global university with students from 185 countries coming to study at the institution. Anglia Ruskin prides itself on being enterprising, and innovative, and nurtures those qualities in students and graduates through mentorship, support and start-up funding on offer through the Anglia Ruskin Enterprise Academy. ARU was the first in the UK to receive the prestigious Entrepreneurial University Award from the National Centre for Entrepreneurship in Education (NCEE), and students, businesses, and partners all benefit from the outstanding facilities available.
About CAMentrepreneurs
CAMentrepreneurs supports business and social entrepreneurship among Cambridge University Alumni, students and others. Since its launch in 2016 CAMentrepreneurs has held more than 67 events in Boston, Cambridge, Dallas, Dubai, Edinburgh, Glasgow, Helsinki, Hong Kong, Houston, Lisbon, London, Oxford, Paris, New
Alec Lawler - A Passion For Building Brand AwarenessAlec Lawler
Alec Lawler is an accomplished show jumping athlete and entrepreneur with a passion for building brand awareness. He has competed at the highest level in show jumping throughout North America and Europe, winning numerous awards and accolades, including the National Grand Prix of the Desert in 2014. Alec founded Lawler Show Jumping LLC in 2019, where he creates strategic marketing plans to build brand awareness and competes at the highest international level in show jumping throughout North America.
This blog explores the impactful leadership of Kunal Bansal, Director of GMI Infra, highlighting his role in community development through events like the KOMPTE Badminton Tournament 2025 in Chandigarh. A reflection on how infrastructure and social responsibility go hand-in-hand in building the future.
Comments on Cloud Stream Part II Mobile Hub V1 Hub Agency.pdfBrij Consulting, LLC
The Mobile Hub Part II provides an extensive overview of the integration of glass technologies, cloud systems, and remote building frameworks across industries such as construction, automotive, and urban development.
The document emphasizes innovation in glass technologies, remote building systems, and cloud-based designs, with a focus on sustainability, scalability, and long-term vision.
V1 The European Portal Hub, centered in Oviedo, Spain, is significant as it serves as the central point for 11 European cities' glass industries. It is described as the first of its kind, marking a major milestone in the development and integration of glass technologies across Europe. This hub is expected to streamline communication, foster innovation, and enhance collaboration among cities, making it a pivotal element in advancing glass construction and remote building projects. BAKO INDUSTRIES supported by Magi & Marcus Eng will debut its European counterpart by 2038.
Best Ever Platform To Buy Verified Wise Accounts In 2025.pdfTopvasmm
We Topvasmm.com now offer fully verified Wise accounts at affordable prices, ideal for both personal and business use. If you’re looking for a reliable Wise account, you’ve come to the right place. Our verified accounts are ready to use and can also help enhance your business reputation or improve your website’s credibility when needed. Get your verified Wise account today and enjoy seamless financial operations. Buy Verified Wise Accounts from Topvasmm.com – One of the world’s leading trusted sellers.
Network Detection and Response (NDR): The Future of Intelligent CybersecurityGauriKale30
Network Detection and Response (NDR) uses AI and behavioral analytics to detect, analyze, and respond to threats in real time, ensuring comprehensive and automated network security.
Jonathan Valetta: Leading with Purpose and Financial KnowledgeJonathan Valetta
Jonathan Valetta transformed personal hardship into a purposeful endeavor. He now teaches Canadians about budgeting, saving, and creating a stable financial future after transitioning from sobriety to financial mentoring.
**Title:** Accounting Basics – A Complete Visual Guide
**Author:** CA Suvidha Chaplot
**Description:**
Whether you're a beginner in business, a commerce student, or preparing for professional exams, understanding the language of business — **accounting** — is essential. This beautifully designed SlideShare simplifies key accounting concepts through **colorful infographics**, clear examples, and smart layouts.
From understanding **why accounting matters** to mastering **core principles, standards, types of accounts, and the accounting equation**, this guide covers everything in a visual-first format.
📘 **What’s Inside:**
* **Introduction to Accounting**: Definition, objectives, scope, and users
* **Accounting Concepts & Principles**: Business Entity, Accruals, Matching, Going Concern, and more
* **Types of Accounts**: Asset, Liability, Equity explained visually
* **The Accounting Equation**: Assets = Liabilities + Equity broken down with diagrams
* BONUS: Professionally designed cover for presentation or academic use
🎯 **Perfect for:**
* Students (Commerce, BBA, MBA, CA Foundation)
* Educators and Trainers
* UGC NET/Assistant Professor Aspirants
* Anyone building a strong foundation in accounting
👩🏫 **Designed & curated by:** CA Suvidha Chaplot
The Five-Year Plan: A Clear Path to Family Business SuccessionCraig Toberman
This professional, workshop-ready PowerPoint presentation is based on the book The Five-Year Plan: A Clear Path to Family Business Succession by Craig Toberman, CFA, CPA, CFP®, MBA. Created for business owners and advisors, this resource helps family businesses navigate succession planning with clarity, confidence, and structure.
Family business succession is one of the most important and complex challenges an owner will face. Without a clear plan, the risks to the business, the family, and the owner's legacy increase dramatically. This presentation simplifies the process into five practical stages, making it easier to start and stick with a proven plan.
The deck is built directly from the framework in The Five-Year Plan and is structured to match each year of the roadmap. It includes clear steps, actionable checklists, engaging visuals, and strategic reflection questions designed to help business owners apply the material immediately. Whether used in a workshop, live seminar, boardroom presentation, or advisory setting, this PowerPoint makes complex ideas approachable and implementation-focused.
Key features include:
• A five-year structure that walks owners through every major milestone in the succession process
• Year 1: Build your personal financial plan and prepare for life beyond the business
• Year 2: Scale and systematize your company to increase its value and reduce dependence on you
• Year 3: Develop future leaders and strengthen your company culture to support long-term growth
• Year 4: Execute your ownership transition through legal, financial, and operational actions
• Year 5: Design a meaningful post-exit life and protect your legacy for the next generation
Each section includes simplified visuals, planning tools, and questions that spark strategic thinking. This is not a promotional deck. It is a practical tool created to guide thoughtful conversations around leadership transition, exit planning, wealth transfer, retirement, and generational continuity.
Best 22 Platform To Purchase Verified Coinbase Account In This Year.pdfTopvasmm
Looking to purchase verified Coinbase accounts in the UK or USA? Coinbase, a publicly listed American company, operates one of the largest and most trusted cryptocurrency exchanges in the world. As the top crypto trading platform in the U.S. by volume, it has become a cornerstone in the digital finance space—benefiting thousands of users daily. Today, over 80% of users rely on Coinbase as their primary payment method for online shopping and financial transactions. Its reliability, ease of use, and alignment with modern financial trends make it a smart choice.
2. 2
Books to Follow
D.S.Malik, “Data Structures using C++”
D.Samanta, “Classic Data Structures”, Prentice Hall
Tenenbaum, M.Augenstein, and Y. Langman, “Data
Structures using C and C++”, Prentice Hall.
3. 3
Some General Comments
Encouragement to ask questions during class
Without your feedback, it is impossible for me to
know what you don’t know?
There is no reason not to ask questions during class
Of course, you could also send email.
Encouragement to read course material prior to
class
Kindly switch off your Mobile Phones during class
4. Introduction to Data Structure
4
A data structure is a particular way of storing and
organizing data in a computer so that it can be
used efficiently
5. Need for Data Structures
Data structures organize data more efficient
programs.
More powerful computers more complex
applications.
More complex applications demand more
calculations.
6. Organizing Data
Any organization for a collection of records that
can be searched, processed in any order, or
modified.
The choice of data structure and algorithm can
make the difference between a program
running in a few seconds or many days.
7. 7
What is Data Structure?
Data structure is a representation of data and the
operations allowed on that data.
A data structure is a way to store and organize
data in order to facilitate the access and
modifications.
Data Structure is the method of representing of
logical relationships between individual data
elements related to the solution of a given problem.
8. 8
Fundamental Data Structures
Hash Tables
Basic Data Structures
Linear Data Structures Non-Linear Data Structures
Linked Lists Stacks Queues Trees
Graphs
Arrays
10. 10
Linear Data Structures
A data structure is said to be linear if its elements
form a sequence or a linear list.
Examples:
Arrays
Linked Lists
Stacks
Queues
11. 11
Non-Linear Data Structures
A data structure is said to be non-linear if its
elements does not form a sequence or a linear list.
Examples:
Trees
Graphs
Hash Tables
Each element may be connected with two or more
other nodes or items in a non-linear arrangement.
12. 12
Operations on Data Structures
Traversal: Travel through the data structure
Search: Traversal through the data structure for a
given element
Insertion: Adding new elements to the data structure
Deletion: Removing an element from the data
structure
Sorting: Arranging the elements in some type of order
Merging: Combining two similar data structures into
one
14. 14
Arrays
A sequence of n items of the same data type that are
stored contiguously in computer memory and made
accessible by specifying a value of the array’s index.
Properties:
fixed length (need preliminary reservation of memory)
contiguous memory locations
direct access
Insert/delete
a[0] a[1] a[2] a[3] a[4] a[5] a[6] a[7] a[8] a[9]
1 2 3 4 5 6 7 8 9 10
Array a with 10 integer elements
15. 15
Linked List
A sequence of zero or more nodes each containing two kinds of
information: some data and one or more links called pointers to
other nodes of the linked list.
Properties
dynamic length
arbitrary memory locations
access by following links
Insert/delete
Types of Linked List
Singly linked list (next pointer)
Doubly linked list (next + previous pointers)
16. 16
Stacks
A stack is a data structure that uses last-in, first-out
(LIFO) ordering and allows reading and writing on the
top element only.
Properties
insertion/deletion can be done only at the top
LIFO
Two operations
Push (insertion)
Pop (removal)
17. 17
Queues
Collection with access only to the item that has been
present the longest
Properties
Insertion/enqueue from the rear (back) and deletion/
dequeue from the front.
FIFO
Two operations
Enqueue
Dequeue
20 30 10 60 57 29
Front Back
19. 19
Graphs
Formal definition: A graph G = <V, E> is defined by a
pair of two sets: a finite set V of items called vertices and a
set E of vertex pairs called edges.
Undirected and directed graphs (digraphs).
Complete, dense, and sparse graphs
Undirected Graph Directed Graph
20. 20
Trees
A Tree is a way of representing the
hierarchical nature of a structure in a
graphical form.
Properties of trees
Root Node
Child Node
Parent Node
Leaf Node
Types
Unordered Tree
Binary Tree is an ordered tree data
structure in which each node has at most
two children.
Ordered Tree
Binary Tree
21. 21
Hash Tables
A hash table is a data structure that uses a hash
function to map identifying values, known as keys
(e.g., a person's name), to their associated values.
22. 22
Summary
A data structure is a particular way of storing and organizing
data in a computer so that it can be used efficiently.
Linear Data Structures
Arrays
Linked List
Stacks
Queues
Non Linear Data Structures
Graphs
Trees
Hash Tables
23. Selecting a Data Structure
Select a data structure as follows:
1. Analyze the problem to determine the
resource constraints a solution must meet.
2. Determine the basic operations that must be
supported. Quantify the resource constraints
for each operation.
3. Select the data structure that best meets
these requirements.
24. Data Structure Philosophy
Each data structure has costs and benefits.
Rarely is one data structure better than another
in all situations.
A data structure requires:
space for each data item it stores,
time to perform each basic operation,
programming effort.
25. A precise rule (or set of rules) specifying
how to solve some problem.
Introduction to Algorithms
25
26. 26
What is an Algorithm?
An algorithm is a sequence of unambiguous
instructions for solving a problem, i.e., for obtaining a
required output for any legitimate input in a finite
amount of time.
Properties
Can be represented various forms
Unambiguity/clearness
Effectiveness
Finiteness/termination
Correctness
27. 27
What is an Algorithm?
Recipe, process, method, technique, procedure, routine,…
with the following requirements:
1. Finiteness
terminates after a finite number of steps
2. Definiteness
rigorously and unambiguously specified
3. Clearly specified input
valid inputs are clearly specified
4. Clearly specified/expected output
can be proved to produce the correct output given a valid input
5. Effectiveness
steps are sufficiently simple and basic
28. 28
Why Study Algorithms?
Algorithms solve problems
Good choice: more efficient programs
Bad choice: poor programs performance
Example:
Problem: Find the largest element ‘k’ out of ‘N’ integers
Easy algorithms: sort all integers, then list the first or last element
Better algorithm: take first element then read through the list
Different algorithms perform better on different inputs
Input size also affect the performance.
30. 30
Representation of an Algorithms
An algorithm may be represented in different
forms:
A description using English/other languages
A real computer program, e.g. C++ or java
A pseudo-code, C-like program, program-language-
like program.
Program = algorithms + data structures
31. 31
Basic Issues Related to Algorithms
How to design algorithms
How to express algorithms
Proving correctness
Efficiency (or complexity) analysis
Theoretical analysis
Empirical analysis
Optimality
33. 33
Algorithm Efficiency
There are often many algorithms for a given
problem. How do we choose the best?
Goals of program design:
Algorithm is to be easy to understand, code, debug
Algorithm makes efficient use of computer’s resources
How to measure the efficiency?
Empirical comparison (run the program)
Asymptotic algorithm analysis (without running the program)
Factors affecting running time (size of the input)
34. 34
Best, Worst and Average Cases
Not all inputs of a given size take the same time.
Each algorithm has three cases:
Best case:
Worst Case:
Average Case:
35. 35
Example: Best, Worst and Average Cases
Sequential search for ‘k’ in an array of ‘n’ integers:
Best case: ‘k’ is the first element of the array.
Worst case: the search must visit every element once.
This happens when the value being searched for is
either the last element in the list, or is not in the list
Average case: on average, assuming the value
searched for is in the list and each list element is
equally likely to be the value searched for, the search
visits only n/2 elements.