Middle East Technical University  Kuzey Kıbrıs Campus
Data
EEE 301

Fall 2014
The Stack Abstract Data Type
The Stack ADT
The Stack ADT stores arbitrary elements.
Insertions and deletions follow the lastin firstout (LIFO)
scheme.
It is like a stack of trays:
Trays can be added to the top of the stack.
Trays can be removed from t
Middle East Technical University  Kuzey Kıbrıs Campus
Data
EEE 301

Fall 2014
LinkedListTypes:DoublyLinkedLists
Linked Lists Types
Types of linked lists:
1. Singly Linked list
1. Begins with a pointer to the first node
2. Terminates with a null pointer
3. Only traversed in one direction
2. Circular Singly Linked List
1. Pointer in
Middle East Technical University  Kuzey Kıbrıs Campus
Data
EEE 301

Fall 2014
The Queue Abstract Data Type
Queues
Similar to a supermarket checkout line or
bus queue
There is no cutting allowed in the line, so the
first person in the line is the first person out of
the line.
Firstin, firstout (FIFO)
Nodes are removed only fro
Middle East Technical University  Kuzey Kıbrıs Campus
Data
EEE 301

Fall 2014
TreeAbstractDataType&
BinarySearchTree
Agenda
Trees
Binary Tree and its properties
Binary Search Tree and its properties
BST Insertion and Deletion
2/41
Trees (Hierarchical Data Structure)
A tree is a collection of nodes
The collection can be empty.
Middle East Technical University  Kuzey Kıbrıs Campus
Data
EEE 301

Fall 2014
MAT281E Linear Algebra and Applications
20162017 Fall Term HW 1 Solutions
6,10,15,17 problems will contribute 80%.
The rest will contribute 20%.
1. (For each of the following) Express the linear system in matrix form, i.e. as
A x b . Indicate
dimensions
Middle East Technical University  Kuzey Kıbrıs Campus
Data
EEE 301

Fall 2014
YER ADI
NASCAR Speed Park
Burger King
Continental
Dunkin' Donuts
Hotel
Hotel
Hotel
Jersey Mike's
Mike's Seafood
Resort
Sunsations
Clothing Store
Hotel
McDonalds
Restaurant
Store
Gift Shop
Hotel
Quailty Inn
Hotel
Island Club Resort
EHR  EYALET
YER TR
Sevi
Middle East Technical University  Kuzey Kıbrıs Campus
Data
EEE 301

Fall 2014
Letter of Recommendation
To Whom It May Concern,
it is with great pleasure that I nd myself writing this letter of recommendation for Zuldin
Khodzhaev. Zuldin is an outstanding employee who on a daily basis goes above and beyond
in his support to E1 lntem
Middle East Technical University  Kuzey Kıbrıs Campus
Data
EEE 301

Fall 2014
Dersin Kodu:
BLG 212E Microprocess
or Systems
BLG 351E Microcompute
r Lab.
retim yeleri:
Gkhan nce &
Eref Adal
MAT 271E Probability
and Statistics
BLG 475E Software
Quality and
Testing
Bir
devin/projenin
teslim edilmi
olarak kabul
edilmesi iin
Yaryl sonu
Middle East Technical University  Kuzey Kıbrıs Campus
Data
EEE 301

Fall 2014
Priority Queue
Queues
Similar to a supermarket checkout line or
bus queue
There is no cutting allowed in the line, so the
first person in the line is the first person out of
the line.
Firstin, firstout (FIFO)
Nodes are removed only from the head
No
Middle East Technical University  Kuzey Kıbrıs Campus
Data
EEE 301

Fall 2014
Data Files and Structures
Structures
Array is a data structure whose elements are all the
same data type.
A structure is a data structure whose individual
elements can differ in type.
It might contain integer elements, floatingpoint
elements, characte
Middle East Technical University  Kuzey Kıbrıs Campus
Data
EEE 301

Fall 2014
Pointers II: Pass by Reference,
Multidimensional Arrays and Pointers
Pass by Reference
In pass by value, a called function receives values
from its calling function, stores the passed values in
its own local parameters, manipulates these
parameters appro
Middle East Technical University  Kuzey Kıbrıs Campus
Data
EEE 301

Fall 2014
1
Lecture 5 Functions
2
Functions
Functions
Modularize a program
Construct a program from smaller pieces or components
These smaller pieces are called modules
Each piece more manageable than the original program
Benefits of functions
a) Divide and co
Middle East Technical University  Kuzey Kıbrıs Campus
Data
EEE 301

Fall 2014
The Stack Abstract Data Type Linked List Implementation
The Stack ADT
The Stack ADT stores arbitrary elements.
Insertions and deletions follow the lastin firstout (LIFO)
scheme.
It is like a stack of trays:
Trays can be added to the top of the stack.
Middle East Technical University  Kuzey Kıbrıs Campus
Data
EEE 301

Fall 2014
MIDDLE EAST TECHNICAL UNIVERSITY, NORTHERN CYPRUS CAMPUS
CNG 301 Data Structures and Algorithms Bonus Assignment
(Up to 15% of the actual mark)
Design a computer game called Guess the root. The game works as follows:
 User will enter the size of the game
Middle East Technical University  Kuzey Kıbrıs Campus
Data
EEE 301

Fall 2014
Pointers: Fundamentals, Pointers and
Arrays, Pointer Arithmetic
Lecture  3
Fundamentals: Remember Addresses!
Output is:
num = 22
The address of num is 124484
CNG 140  lecture 123
2/26
Pointers
numaddr = #
A variable that can store an address is k
Middle East Technical University  Kuzey Kıbrıs Campus
Data
EEE 301

Fall 2014
The Queue Abstract Data Type
Queues
Similar to a supermarket checkout line or
bus queue
There is no cutting allowed in the line, so the
first person in the line is the first person out of
the line.
Firstin, firstout (FIFO)
Nodes are removed only fro
Middle East Technical University  Kuzey Kıbrıs Campus
Data
EEE 301

Fall 2014
Data Files
Introduction
To store and retrieve data outside a C program, you
need two items:
A file
A file stream
File: collection of data that is stored together
under a common name, usually on a disk,
magnetic tape, or CDROM
Each file has a unique
Middle East Technical University  Kuzey Kıbrıs Campus
Data
EEE 301

Fall 2014
Abstract Data Types (ADT) &
Fundamentals of Linked Lists
Abstract Data Types
An Abstract Data Type (ADT) is:
a set of values
a set of operations, which can be applied uniformly to all
these values
To abstract is to leave out information, keeping (hopefu
Middle East Technical University  Kuzey Kıbrıs Campus
Data
EEE 301

Fall 2014
Linked List Operations
Defining a Node and a List
structNode
cfw_
intval;
structNode*next;
;
structListRecord
cfw_
structNode*head;
structNode*tail;
intsize;
;
typedefstructListRecord*List;
List myList;
2/20
Basic Linked List Operations
Insert a node
Dele
Middle East Technical University  Kuzey Kıbrıs Campus
Data
EEE 301

Fall 2014
Useful tips for
negotiating a salary
Tips on negotiating your
salary
Each company's salary system is set up differently. Beside the
amount of the basic salary, employment contracts also tend to
regulate the socalled variable salary component. This is tie