Data Structures and Algorithms
Data Structures and Algorithms
CS 321 E2
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'.
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