# Nt1310 Unit 2 Assignment

1391 Words6 Pages

FACULY OF NATURAL SCIENCE
DEPARTMENT OF COMPUTER SCIENCE
NAME OF STUDENT : S. GANGATA
STUDENT NUMBER : 213240300
MODULE : DATA STRUCTURES
MODULE CODE : CSI22M2
TOPIC : ROLE OF DATA STRUCTURES
QUALIFICATION : B Sc. COMPUTER SCIENCE
DUE DATE : 04-08-2015
LECTURER : MR L. TINARWO

1. Stack
Properties
(Weiss, 1992) In a stack insertion and deletion are performed only in one position called the top. Operations of the stack are push, and push is the same as to insert, and pop which deletes is an element that is recently inserted. That element is pre-examined to performing a pop using routine. A stack uses the LIFO order which stands for Last In First Out. For example in a stack of boxes when you want …show more content…

Designing a queuing system
This one can be used in banks, grocery stores, theatre movies et cetera, and people try to execute their programs using the same processors.
2. Customer
Each customer have got the arrival time, waiting time and time for leaving. Every customer follows those operations sequentially.
3. Server
All the servers have timer, the program should know which customers are served by which customers.
3. Trees
(Malik, 2010)Trees are used to represent arithmetic and Boolean expressions. A tree as a data structure arranges the collection of items using a hierarchical structure. Mathematical formulas are represented using the trees. Trees also help in the analysis of electrical circuits. “The function search searches binary search tree for a given item”. Item returns true if it is found in the binary tree but false if it is not found. When we have inserted an item in a binary search tree, the resulting binary tree have to be a binary search tree too.
Applications
1. Coding and data compression
Reduction of the number of bits used to store or transmit data
2. Spell checker
Helps on words that have been typed wrongly
3. Genealogies
For tracing the history of the families

Used in sociology.
6. Hash table
Properties
(Malik, 2010) Hash table is denoted by HT and it is stored in an array. Hash function is denoted by h and we calculate h(X) where X is the element of an item to find the address of the item in the hash table. Data is organised in two ways, firstly data is stored within the hash table i.e. in an array. Secondly it is stored in linked lists and the hash table is an array of pointers to such linked lists.
Applications and some examples
1. Mid-Square -We square the identifier when calculating the hash function.
2. Folding
The key X is partitioned to parts so that all parts have the same length except the last parts.
3. Collision resolution
Its techniques are classified into two categories namely open addressing (or closed hashing) and chaining (or open hashing).