IT265 Summary and pseudocode

profilepxmptee
IT265_Williams_IP3.docx

1

Charles Williams

IT265-1804A-01

Unit 4 Discussion Board

Dr. Jesus Borrego

Contents

Data Structures Using Java Document Shell 1

Abstract 3

Section 1: List, Stacks, and Queues 4

Implement 2 programs for Stacks and Queues 4

Section 2: Heads and Trees 8

Section 3: Sorting Algorithms 8

Section 4: Searching (TBD 9

Section 5: Recursion (TBD) 9

Conclusion (TBD) 12

References 13

Abstract

This research paper will explain the use of pseudo code for stacks, queues, and hashing implementations, sorting algorithms, searching for values, and generating a factorial of a number using recursion. Implementing a linked list can be executed using the stack and queue methods along with each of their respected basic operations. The use of a binary tree is important when considering searching for keys in an array and linked list. This information will likely assist users to understand the implementation of code and the results it could provide for specific requests.

Stack

//create a class Node

class Node:

//create node attributes data and next reference node

Data

Node NextRef

//Node constructor

Node(x, Node y):

Data = x

NextRef = y

getData():

return Data

Node getNext():

return NextRef

Node setNext(Node n):

NextRef = n

// Initialize Head and Tail to be null

Node Head = NULL

Node Tail = NULL

// Set initial size to 0

size = 0

// To check if the list is empty

IsEmpty():

if size == 0:

return TRUE

else

return FALSE

// Insert item on top

push(item):

// set the new item as the head and the current head as the next

Head = new Node(item, Head)

// set the tail to be the head if the list is empty

if IsEmpty():

Tail = Head

//increment the size

size += 1

//Remove element on top

pop():

//check if the list is empty

if IsEmpty():

return NULL

else:

//set the head to be the previous node

Head = Head.getNext()

// Decrement the size

size -= 1

if size == 0:

Tail = NULL

display():

//set the first node as the head

Node myNode = Head;

//iterate as long as the node is not null

While myNode != NULL:

//print out node details

print "Data : " + myNode.getData()

print "NextRef : " + myNode.getNext()

// set the node to the next node

myNode = myNode.getNext()

Queue

//create a class Node

class Node:

//create node attributes data and next reference node

Data

Node NextRef

//Node constructor

Node(x, Node y):

Data = x

NextRef = y

getData():

return Data

Node getNext():

return NextRef

Node setNext(Node n):

NextRef = n

// Initialize Head and Tail to be null

Node Front = NULL

Node Rear = NULL

// Set initial size to 0

size = 0

// To check if the list is empty

IsEmpty():

if size == 0:

return TRUE

else

return FALSE

//Add to the Rear

enqueue(item):

//create a new node initialize the data to item and NextRef to Null

Node newNode = new Node(item, NULL)

//If the list is empty set the front as the new node else set rear as the new node

if IsEmpty():

Front = newNode

else:

Rear.setNext(newNode)

//set the rear as new node

Rear = newNode

//Remove from the Front

dequeue():

//check if the list is empty

if IsEmpty():

return NULL

else:

//set the front to be the previous node

Front = Front.getNext()

// Decrement the size

size -= 1

if size == 0:

Rear = NULL

display():

//set the first node as the head

Node myNode = Head;

//iterate as long as the node is not null

While myNode != NULL:

//print out node details

print "Data : " + myNode.getData()

print "NextRef : " + myNode.getNext()

// set the node to the next node

myNode = myNode.getNext()

Sorting Algorithms

A sorting algorithm arranges elements in a list in some specific order. The most commonly used orders are lexicographical order and numerical order. Sorting helps in the improvement of the efficiency of the algorithms. Canonicalization of data and the production of human readable output also require sorting. The output of a sorting algorithm must be in a non-descending order. The output also should be the permutation of the input. The input of a sorting algorithm is usually stored in an array.

Selection Sort

In terms of implementation, selection sort is the simplest sorting algorithm. Notably, it works by finding a desired element in unsorted list. The element can either be the largest or the highest item in the array. The sorted element is then swapped with the element in the first position in the list. The next largest or smallest element in the sorted list Is then found and swapped with the second element in the sorted list. The process is continuous as there is an increment is the sorted elements at the top of the list and the other items remain unsorted. In sum, Smyth (2007) states that the algorithm for selection sort is as follows for arranging elements in ascending order. The sorting algorithm is most suited for small data sets as it has worst case and complexities of 0(n2). In this case, n represents the number of items.

Insertion Sort

Insertion sort is a sorting algorithm based on comparisons. The inserted element in the sub-list finds it place in the sorted list where it is inserted (Biernacki, 2013). There is a sequential searching of the array and the items which are unsorted move to for insertion in the sub-list which is unsorted. The algorithm is best applied in large data sets because it has a worst case and average case scenario of 0(n2). The n is the number of items.

Quicksort

The sorting algorithm has elevated level of efficiency. It involves data partitioning of data arrays into smaller ones. There is a recursive calling of the resulting arrays into subarrays. It is based on comparisons.

Best Sorting Algorithm: Quicksort

Quick sort has a worst case and average complexity of 0(n2). In this case, n represents the number of items. It is, therefore, very efficient for large data sets. After the division of the elements into two parts, there is the need for a pivot (Jha, 2017). The pivot can be chosen in diverse ways.

The largest, the first, the last, the median or just a random number can be picked as the pivot. Quicksort has several advantages such as fast speed of execution, doesn’t require extra storage as it operates in place. The Pseudo code for quick sort is as follows:

Procedure quickSort (right, left)

If left-right <= 0

return

else

pivot = A[left]

partition = partitionFunc (right, left, pivot)

quicksort (right, partition -1)

quicksort (partition + 1, left)

end if

end procedure

Installation and Configuration of Local Area Network (LAN)

Installation and configuration is a major component in the in the overall Network Implementation plan. Installation can be defined as the as the process of preparing or making a system or a program to be ready for execution while the configuration is arranging the functional units according to their chief characteristics, number, and nature. The configuration will determine the selection of the software, firmware, hardware settings, and documentation. It also determines the performance and functionality of the system (Zaheer & Arslan, 2016). Therefore our study will examine the steps followed to install and configure Local Area Network.

Local area network has a simple layout. It has clients, access points, routers and gateway components. Clients are typically the end point of the network such as computers while the access point enables the devices to communicate with each other through wireless networks. Routers connect different hubs or subnets and help in the dissemination of information to the right destination. The gateway will connect the network to another network which is usually the internet. Each component must be there before the installation and configuration take place.

The Local Area Networks majorly uses the IEEE 802.11{1} standards. These standards will help to enhance the operating frequency and the connection speed. They use the twisted pair to fix the Ethernet connections. The twisted pair has a bandwidth of 100 MHZ which can support 100Mbs transmissions which is effective for faster Ethernet speeds. You can use CAT6 for higher speed if need be. The IEEE 802 family of standards gives specifications for wireless LANs. This includes Power over Ethernet standard which enables the Ethernet to facilitate switching between the access points and the IP telephones. There are major factors to consider while implementing installing LAN networks such as the security of the system. LAN uses wire Equivalent Privacy (WEP), and also Wi-Fi protected access to maintain the security. There are so many loopholes in the WEP so it is being replaced by the WPA. Small businesses can use WPA for security purposes. The network security generates a 256-bit key which is used to authenticate the access points (Gupta, 2016)

Implementation process which major on the installation and configuration of the system needs a thorough preparation. These are several steps involved when installing the network. This includes preparing the move; this is done in advance to prepare for the relocation of the employees so that the installation process can be smooth and effective. This kind of preparation includes tagging the chargers, dockings stations and computers with computer names. The employees should pack their working stations in a moving box. In case the user wants to continue using his monitor in the new working station he should also tag it with his name or else the monitor will be distributed randomly in the new working station. Every employee will be assigned a new location in the new station. The next step will be to conduct a test in the current working station. This will help in detecting any problem with the current system such as users being unable to log in and this can be solved by upgrading the software with the new software. Once the works have relocated, printers and furniture will be moved to the new office. Once the new office has been set up the LAN is set up. Cables with high capacity or stable connection will be laid to the working stations. Once the working stations are in order the employees will be allowed to come in and log in their computers to see if they are working correctly as the LAN cables have been installed.

The disconnected printers and scanners will be connected back to the LAN cable to ensure that the employees can share them instead of having each working station with its own printer or scanner. This will enable the remote access and sharing of the resources in the office. The machine to machine communication will be facilitated using the new installed LAN network. The computer will also be configured to ensure that electronic mails are sent from one hub to another without any cost. Through Network Pro toolkit the distributed network through LAN will be able to share data (Markusen, 2017)

The new office will have new LAN ports and WLAN access points. Once the ports are in place computers will be connected to the nearest switches. The LAN will also be connected to the IT room to monitor the functionality of the cables and the network. Other facilities such as conference rooms will have LAN cables laid on the floor and the connectivity done to the conference tables

During the installation and configuration process, specific considerations were put in place such as the urgency of a stable Lan Network in the Customer care departments. This led to the decision of department offices so as to avoid the risk of devices throughput reduction, other employees were allowed to use WLAN connectivity has the LAN is been installed. Another key issue that the company had to consider is whether to purchase a security certificate for the network or have a network password. The LAN guest networks passwords should be manually changed periodically (Perlman, 2016). The throughput of the new installed LAN network should be monitored regularly to ensure no session loss is experienced due to poor network connectivity.

Conclusion

References

Smyth, T. (2007). CMPT lecture 126: Sorting and searching, lecture 8. Retrieved from:

https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwjum8zUoZ7cAhVEaRQKHXw2DEsQFggoMAA&url=https%3A%2F%2Fwww.cs.sfu.ca%2F~tamaras%2FsortAndSearch%2FsortAndSearch.pdf&usg=AOvVaw0LeGA2Wtg4LAKUx7Lk-Cih

Jha, S. (2017). Revisiting calculation of moments of number of comparisons used by the

randomized quick sort algorithm. Discrete Mathematics, Algorithms and Applications, 9(1), 1750001.

Biernacki, C. (2013). A generative model for rank data based on insertion sort algorithm.

Computational Statistics & Data Analysis, 58, 162-176.

(2018). Retrieved from http://www.cs.sfu.ca/CourseCentral/225/jmanuch/lec/4-3.ppt

(2018). Retrieved from http://www.dtic.upf.edu/~rramirez/TA/stack.pdf

GeeksforGeeks. (2018). Linked List Data Structure - GeeksforGeeks. [online] Available at: https://www.geeksforgeeks.org/data-structures/linked-list/

Cs.cmu.edu. (2018). LinkedLists. [online] Available at: https://www.cs.cmu.edu/~adamchik/15-121/lectures/Linked%20Lists/linked%20lists.html

Btechsmartclass.com. (2018). Stack using Linked List - Data Structures. [online] Available at: http://btechsmartclass.com/DS/U2_T3.html

Pages.cs.wisc.edu. (2018). Stacks and Queues. [online] Available at: http://pages.cs.wisc.edu/~vernon/cs367/notes/5.STACKS-AND-QUEUES.html

Gupta, S. (2016). A Comparative Analysis of Wired and Wireless Network Architecture. International Journal of Emerging Trends in Research, 1(1), 05-11.

Markusen, A. (2017). Sticky places in slippery space: a typology of industrial districts. In Economy (pp. 177-197). Routledge.

Perlman, R., Kaufman, C., & Speciner, M. (2016). Network security: private communication in a public world. Pearson Education India.

Zaheer, S., & Arslan, E. (2016). Installation and Configuration. In Practical Oracle E-Business Suite (pp. 35-102). Apress, Berkeley, CA.