IT 152 Data Structures and Algorithms Tonga Institute of Higher Education.

Slides:



Advertisements
Similar presentations
Symbol Table.
Advertisements

Overview of Data Structures and Algorithms
Hashing as a Dictionary Implementation
Dictionaries and Their Implementations Chapter 18 Data Structures and Problem Solving with C++: Walls and Mirrors, Carrano and Henry, © 2013.
Lecture - 1 on Data Structures. Prepared by, Jesmin Akhter, Lecturer, IIT,JU Data Type and Data Structure Data type Set of possible values for variables.
Recursion. Binary search example postponed to end of lecture.
© 2006 Pearson Addison-Wesley. All rights reserved13 A-1 Chapter 13 Hash Tables.
Data Structures & Algorithms What The Course Is About s Data structures is concerned with the representation and manipulation of data. s All programs.
Review for Test 2 i206 Fall 2010 John Chuang. 2 Topics  Operating System and Memory Hierarchy  Algorithm analysis and Big-O Notation  Data structures.
Introduction and a Review of Basic Concepts
Design and Analysis of Algorithms - Chapter 71 Hashing b A very efficient method for implementing a dictionary, i.e., a set with the operations: – insert.
Elementary Data Structures and Algorithms
© 2006 Pearson Addison-Wesley. All rights reserved13 B-1 Chapter 13 (excerpts) Advanced Implementation of Tables CS102 Sections 51 and 52 Marc Smith and.
1 ES 314 Advanced Programming Lec 2 Sept 3 Goals: Complete the discussion of problem Review of C++ Object-oriented design Arrays and pointers.
Data Structures 1- Course Syllabus. 2- Introduction about Data Structures.
Data Structures Lecture-1:Introduction
C o n f i d e n t i a l Developed By Nitendra NextHome Subject Name: Data Structure Using C Title: Overview of Data Structure.
Copyright © Wondershare Software Introduction to Data Structures Prepared by: Eng. Ahmed & Mohamed Taha.
ICS220 – Data Structures and Algorithms Lecture 10 Dr. Ken Cosh.
B+ Tree What is a B+ Tree Searching Insertion Deletion.
Comp 249 Programming Methodology Chapter 15 Linked Data Structure - Part B Dr. Aiman Hanna Department of Computer Science & Software Engineering Concordia.
Symbol Tables Symbol tables are used by compilers to keep track of information about variables functions class names type names temporary variables etc.
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
Introduction to Data Structures Fall 2008 Dr. David A. Gaitros
Min Chen School of Computer Science and Engineering Seoul National University Data Structure: Chapter 1.
Information and Computer Sciences University of Hawaii, Manoa
Data Structures and Algorithms Stacks. Stacks are a special form of collection with LIFO semantics Two methods int push( Stack s, void *item ); - add.
© 2006 Pearson Addison-Wesley. All rights reserved13 B-1 Chapter 13 (continued) Advanced Implementation of Tables.
CSS446 Spring 2014 Nan Wang.  Java Collection Framework ◦ Set ◦ Map 2.
DATA STRUCTURES & C# GENERICS Trent Spangler | Greg Phelps.
David Luebke 1 10/25/2015 CS 332: Algorithms Skip Lists Hash Tables.
Overview of Course Java Review 1. This Course Covers, using Java Abstract data types Design, what you want them to do (OOD) Techniques, used in implementation.
Linked Lists Tonga Institute of Higher Education.
Chapter 1 Data Structures and Algorithms. Primary Goals Present commonly used data structures Present commonly used data structures Introduce the idea.
AEEE 195 – Repetition Structures: Part B Spring semester 2011.
Storage and Retrieval Structures by Ron Peterson.
1 5. Abstract Data Structures & Algorithms 5.2 Static Data Structures.
C Operators. CONTENTS C OPERATORS TYPES OF OPERATOR UNARY BINARY TERNARY ARITHMATIC RELATIONAL LOGICAL.
What have we learned?. What is a database? An organized collection of related data.
Min Chen School of Computer Science and Engineering Seoul National University Data Structure: Chapter 2.
HASHING PROJECT 1. SEARCHING DATA STRUCTURES Consider a set of data with N data items stored in some data structure We must be able to insert, delete.
Hashing is a method to store data in an array so that sorting, searching, inserting and deleting data is fast. For this every record needs unique key.
© Mike Stacey 2008 Single Chip Microcontrollers 7765J Mount Druitt College of TAFE Lesson 3 Arrays in ASM, Bubble Sort algorithm.
CHAPTER 8 SEARCHING CSEB324 DATA STRUCTURES & ALGORITHM.
Lecture by: Prof. Pooja Vaishnav.  Language Processor implementations are highly influenced by the kind of storage structure used for program variables.
Elementary Data Organization. Outline  Data, Entity and Information  Primitive data types  Non primitive data Types  Data structure  Definition 
Collections Data structures in Java. OBJECTIVE “ WHEN TO USE WHICH DATA STRUCTURE ” D e b u g.
Data Structures for Midterm 2. C++ Data Structure Runtimes.
1 Algorithms Queues, Stacks and Records stored in Linked Lists or Arrays.
Chapter 5 Linked List by Before you learn Linked List 3 rd level of Data Structures Intermediate Level of Understanding for C++ Please.
Chapter Lists Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2010.
Dictionaries and Their Implementations Chapter 18 Data Structures and Problem Solving with C++: Walls and Mirrors, Frank Carrano, © 2012.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To introduce the basic concepts of linked lists ❏ To introduce the basic concepts.
CSC 413/513: Intro to Algorithms Hash Tables. ● Hash table: ■ Given a table T and a record x, with key (= symbol) and satellite data, we need to support:
© 2006 Pearson Addison-Wesley. All rights reserved15 A-1 Chapter 15 External Methods.
CSC 143T 1 CSC 143 Highlights of Tables and Hashing [Chapter 11 p (Tables)] [Chapter 12 p (Hashing)]
L131 Assignment Operators Topics Increment and Decrement Operators Assignment Operators Debugging Tips rand( ) math library functions Reading Sections.
Introduction toData structures and Algorithms
Midterm Review.
ENEE150 Discussion 09 Section 0101 Adam Wang.
Basic notes on pointers in C
2008/10/27: Lecture 13 CMSC 104, Section 0101 John Y. Park
CS Data Structure: Heaps.
2008/10/27: Lecture 13 CMSC 104, Section 0101 John Y. Park
Assignment Operators Topics Increment and Decrement Operators
COP3530- Data Structures Introduction
Assignment Operators Topics Increment and Decrement Operators
Assignment Operators Topics Increment and Decrement Operators
Assignment Operators Topics Increment and Decrement Operators
What is this course about?
Presentation transcript:

IT 152 Data Structures and Algorithms Tonga Institute of Higher Education

What are Data Structures and Algorithms? Data Structure – An arrangement of data in a computer’s memory  Examples: arrays, linked lists, stacks, binary trees and hash tables. Algorithms – A series of steps used to manipulate the data in these structures  Examples: Searching, Sorting, Inserting

Why is this important? The correct choice of data structures and algorithms allows major improvements in program efficiency Goals  Works correctly  Easy implementation  Fast  Efficient with memory  Scalable

Increments and Decrements Increments and Decrements are often used when analyzing data structures and algorithms Special operators are often used for increments and decrements. We must understand how to use these to succeed in this class

Increment / Decrement Operator by Itself Increment Operator: ++  Adds 1 to the variable  Example: int x = 4; x++; System.out.println(x);//5 is printed out Decrement Operator: --  Subtracts 1 from the variable  Example: int x = 4; --x; System.out.println(x);//3 is printed out When an increment operator or decrement operator is by itself, it doesn’t matter whether it is before or after the variable

Pre-Increment/Decrement and Post-Increment/Decrement - 1 Pre-Increment / Pre-Decrement: Operator is placed before the variable  --x  ++x Post-Increment / Post-Decrement: Operator is placed after the variable  x--  x++ When you see something like this, you must think about whether the ++ or -- is before or after  Z = x++;  Z = x--;  Z = ++x;  Z = --x;

When you see something like this, you must think about whether the ++ or -- is before or after  Z = x++;  Z = x--;  Z = ++x;  Z = --x; Example: int x = 4; int z; z = ++x; //The value of z is 5 Example: int y = 4; int z; z = y++; //The value of z is 4 The pluses and minus are after. So, put the original value of x in Z Pre-Increment/Decrement and Post-Increment/Decrement - 2 The pluses and minus are before. So, put the incremented/decremented value of x in Z

Plus Equals Operator The += operator is the plus equals operator Example x += 1 Is the same as x = x + 1

Definitions Key – A piece of data used to uniquely identify a record  Example: Student ID, Customer ID Pointer / Reference - A variable that contains the address of a location in memory.  Example: Record Pointer