Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
32 views

Algorithms and Data Structures

This document introduces various algorithms and data structures, including static and dynamic data structures like arrays, stacks, queues, linked lists, trees, and graphs. It outlines three steps to studying data structures: a logical description, implementation on a computer, and quantitative analysis. Specific data structures covered in more depth include lists (array and linked lists), stacks, queues, trees, and hash tables.

Uploaded by

waleed_saghar
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Algorithms and Data Structures

This document introduces various algorithms and data structures, including static and dynamic data structures like arrays, stacks, queues, linked lists, trees, and graphs. It outlines three steps to studying data structures: a logical description, implementation on a computer, and quantitative analysis. Specific data structures covered in more depth include lists (array and linked lists), stacks, queues, trees, and hash tables.

Uploaded by

waleed_saghar
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Algorithms and Data Structures

(CSC112)
Handout -1
Introduction to Algorithms and Data Structures

Algorithms and Data Structures


Static Data Structures
Searching Algorithms
Sorting Algorithms
List implementation through Array
ADT: Stack
ADT: Queue
Dynamic Data Structures (Linear)
Linked List (Linear Data Structure)
Dynamic Data Structures (Non-Linear)
Trees, Graphs, Hashing

3 steps in the study of data structures


Logical or mathematical description of the structure
Implementation of the structure on the computer
Quantitative analysis of the structure, which includes determining the amount of memory
needed to store the structure and the time required to process the structure

Lists (Array /Linked List)


Items have a position in this Collection
Random access or not?
Array Lists
internal storage container is native array

Linked Lists
public class Node
{

private Object data;


private Node next;

Stacks
Collection with access only to the last element inserted
Last in first out
insert/push
remove/pop
top

make empty

Queue

Trees
Similar to a linked list
public class TreeNode
{

private Object data;


private TreeNode left;
private TreeNode right;

Hash Tables
Take a key, apply function
f(key) = hash value
store data or object based on hash value
Sorting O(N), access O(1) if a perfect hash function and enough memory for table
how deal with collisions?

-----------------------------------------------

You might also like