0% found this document useful (0 votes)
91 views

Data Structures and Algorithms

This document discusses various data structures and algorithms. It covers linked lists, including singly linked lists, doubly linked lists, and circular linked lists. It also discusses stacks and queues as well as common operations on each. Searching techniques like linear search, binary search, and hash tables are explained. The document provides references for further reading on these topics.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
91 views

Data Structures and Algorithms

This document discusses various data structures and algorithms. It covers linked lists, including singly linked lists, doubly linked lists, and circular linked lists. It also discusses stacks and queues as well as common operations on each. Searching techniques like linear search, binary search, and hash tables are explained. The document provides references for further reading on these topics.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Data Structures and Algorithms

CS 321 E2

Diaz, Gienel John T.

A. Linked Lists
1. Linked Lists - linked lists contain nodes which have a data field as well as a 'next' field,
which points to the next node in line of nodes. Operations that can be performed on
singly linked lists include insertion, deletion and traversal.

2. Doubly Linked Lists - In a 'doubly linked list', each node contains, besides the next-node
link, a second link field pointing to the 'previous' node in the sequence. The two links
may be called 'forward('s') and 'backwards', or 'next' and 'prev'('previous').

3. Circular Linked Lists- In the last node of a list, the link field often contains
a null reference, a special value used to indicate the lack of further nodes. A less common
convention is to make it point to the first node of the list; in that case the list is said to be
'circular' or 'circularly linked'; otherwise it is said to be 'open' or 'linear'.

B. Stack and Queue


1. Stack - A stack is a basic data structure that can be logically thought as linear structure
represented by a real physical stack or pile, a structure where insertion and deletion of
items takes place at one end called top of the stackThere are basically three operations
that can be performed on stacks . They are 1) inserting an item into a stack (push). 2)
deleting an item from the stack (pop). 3) displaying the contents of the stack(pip).

2. Expression Parsing - Calculators employing reverse Polish notation use a stack structure
to hold values. Most of the programming languages are context-free languages allowing
them to be parsed with stack based machines.

3. Queue - A queue is a basic data structure that is used throughout programming. The first
one in the line is the first one to be served.

C. Searching Technique
1. Linear Search - The most obvious algorithm is to start at the beginning and walk to the
end, testing for a match at each item.

2. Binary Search - If we started at the middle of the list we could determine which half the
item is in (because the list is sorted). This effectively divides the working range in half
with a single test. By repeating the procedure, the result is a highly efficient search
algorithm called binary search.

3. Linear search - an algorithm for searching for a given key value in an indexed array that
has been ordered by the values of the key. In each search step it calculates where in the

remaining search space the sought item might be, based on the key values at the bounds
of the search space and the value of the sought key, usually via a linear interpolation.

4. Hash Table - a data structure used to implement an associative array, a structure that can
map keys to values. A hash table uses a hash function to compute an index into an array
of buckets or slots, from which the desired value can be found.

References:

https://en.wikibooks.org/wiki/Data_Structures/Stacks_and_Queues#Queues
https://en.wikipedia.org/wiki/Hash_table
https://en.wikipedia.org/wiki/Interpolation_search
http://www.cprogramming.com/discussionarticles/sorting_and_searching.html
https://www.cs.cmu.edu/~adamchik/15-121/lectures/Stacks%20and%20Queues/Stacks
%20and%20Queues.html
https://en.wikipedia.org/wiki/Linked_list

You might also like