Sunday, August 28, 2022

CPT 307 Week 5 Newbie to Newbie

Applying algorithmic design and data structure techniques creating structured programs

 

https://www.prepbytes.com/summer-programs/master-data-structures-and-algorithms

           The information industry wants structured applications that efficiently handle the enormous amount of required data. For example, companies like Amazon and Facebook have large amounts of information that must be easily accessed and stored. Proper design of data structures combined with the best algorithms creates a fast retrieval from searching and sorting these massive data structures. According to Shaffer (2013), There is a benefit and costs attributed to each algorithm and data structure created. Having the fastest search and sort Big O time may result in having taken up too much space (Zeigler, J. (2004).

Learning about the different data structures helps understand that some are best in some situations, not others. The same holds true for algorithms. Algorithmic thinking is breaking a problem down into input – problem – output. The key is matching a data structure and algorithms to the needs of the application at hand and making efficient use of the systems resources (section 1). Problems of the past that could not be solved are now ready to be solved. New processing power and precise design of these systems combined with data structures and algorithms are needed to meet the demands today and in the future.

Some basic examples of data structures include stack, array, queue, stack, tree, linked lists, hash tables, trees, heaps, graphs, etc. An excellent website to review some of these data structures is by Mallawaarachchi (2020) https://towardsdatascience.com/8-common-data-structures-every-programmer-must-know-171acf6a1a42.

https://towardsdatascience.com/seven-7-essential-data-structures-for-a-coding-interview-and-associated-common-questions-72ceb644290


https://coderscat.com/how-to-learn-data-structures-and-algorithms/

Some basic sort algorithms are merge, quick, bucket, heap, counting, etc. Some sorts are faster than others on small data but could take years to sort millions of data items. Search algorithms like linear search, search one by one, and binary search uses divide and conquer is faster but requires the list to be sorted. Some other search algorithms are Depth/Breadth First search, hashing, Dynamic programming, String matching and Parsing, Exponentiation by squaring or Binary exponentiation, and many others (Ozturk.27, 2016). Ozturk27 gives an example of Binary exponentiation:

“Say you want to calculate 232. Normally we’d iterate 32 times and find the result. What if I told you it can be done in 5 iterations?”

“Exponentiation by squaring or Binary exponentiation is a general method for fast computation of large positive integer powers of a number in O(log2N). Not only this, but the method is also used for computation of powers of polynomials and square matrices. (p5)”

Some algorithms and data structure designs are better than others. For example, Brute-force or exhaustive search can take little time if done on a small power of 2 or 3, but as the powers get larger, the method could take years in the worst case (Complexity (n.d). Another example would be the google search engine algorithm, which is unique in ranking web pages to allow search by relevancy. Analyzing the program, and quantifying resources, will determine which data structure and algorithm can be used for each situation (Lysecky, Vahid, Lysecky, & Givargis, (2015). A good course that explains Algorithms and Data Structures is by McGavren (2021), located at the following link: https://www.youtube.com/watch?v=8hly31xKli0.

As a new programmer learning as many techniques as possible in developing structured programs will assist in the journey to apply algorithmic design and data structure techniques in developing structured programs. Each situation requires analysis to find the needs to meet the expectations of a successful program. Utilizing testing methods for a specific range of different data structures and algorithms is necessary for effective results. Breaking problems down into simpler subproblems can lead to quickly solving the complex issues later (Ozturk.27, 2016). Programming will require understanding data structure and algorithms to design a better future for all.

 

https://universalfreecourse.com/data-structures-and-algorithms-in-python-free-download

 


 

References

Complexity analysis (Links to an external site.). (n.d.). Retrieved from http://www.cs.utexas.edu/users/djimenez/utsa/cs1723/lecture2.html

Lysecky, R., Vahid, F., Lysecky, S., & Givargis, T. (2015). Data structures essentials. Retrieved from https://zybooks.zyante.com/#/zybook/DataStructuresEssentialsR25/chapter/1/section/3

McGavren J. (18 March 2021) Algorithms and Data Structures Tutorial - Full Course for Beginners. Retrieved from https://www.youtube.com/watch?v=8hly31xKli0

Mallawaarachchi V. (27 February 2020) 8 Common Data Structures every Programmer must know. Retrieved from https://towardsdatascience.com/8-common-data-structures-every-programmer-must-know-171acf6a1a42

Ozturk.27 (21 November 2016) 7 algorithms and data structures every programmer must know. Retrieved from https://u.osu.edu/cstutorials/2016/11/21/7-algorithms-and-data-structures-every-programmer-must-know/

Shaffer C. (March 2013) Data Structures and Algorithm Analysis. Retrieved from

            https://people.cs.vt.edu/~shaffer/Book/JAVA3elatest.pdf

Zeigler, J. (2004). Time, complexity, space complexity, and the O-notation (Links to an external site.). Retrieved from http://www.leda-tutorial.org/en/official/ch02s02s03.html 

Tuesday, August 2, 2022

CPT 307 Object - Oriented Programing (OOP's) Java installation

 

https://www.oracle.com/java/technologies/downloads/#jdk18-windows

Beginning with Java installation

Hello fellow Java enthusiasts,

Getting started with Java can seem daunting to the new programmer. I am going to share some resources I used that helped me start on the journey of coding with Java.

            The journey begins with Oracle (2015) explaining Object-Oriented programming concepts at http://docs.oracle.com/javase/tutorial/java/concepts/index.html. They explain objects, class, inheritance, interfaces, and packages in detail. Objects have state and behavior. For example, a car have state (name, color, make, speed) and behavior (Steering, gas pedal, applying brakes). Software objects are similar to real objects. Classes are like thousands of cars of the same make and model with the same blueprints of objects like cars. Inheritance is different kinds of objects like trucks, jeeps, caravans, and standard or automatic. In Java, each class is allowed to have one superclass that has the potential to have unlimited subclasses. The interface is the interaction with the outside by methods formed by objects. You interface with a car by buttons for Cruise control and many more. An interface allows a class to interact with the outside world. A package is like the different folders on your computer of various types. This is how thousands of other classes are organized for ease of use. Now that we know about OOP concepts let's move toward finding and installing Java.

Installing Java

Installing Java involves going to https://www.oracle.com/java/technologies/downloads/

and choosing between Linux, macOS, or Windows downloads. Once downloaded, the website includes instructions for installation, which will help if any complications arise. For example, I installed the download on Windows 10, and for some reason, it did not install to the correct path, and the instructions helped explain how to click on the download again and repair the path link.

Using Notepad++  to create a “Hello World” Java program to run in Power Shell or Command line. (No IDE editor needed).

The tutorial at https://docs.oracle.com/javase/tutorial/getStarted/cupojava/win32.html

explains in great detail how to complete a simple “Hello World” program in Java using Notepad++ downloaded at https://notepad-plus-plus.org/downloads/v8.4.4/

and PowerShell or command terminal to compile and create a .class file and run the .java program. The commands used to compile a class “javac HelloWorldApp.java” and execute “java -cp . HelloWorldApp” were the commands I used, except I made a HelloMynameApp.java and HelloMynameApp.class files which made the program more personal.

Example of java file and class file.


IDE installation

Downloading an IDE like Virtual Studio Code at https://code.visualstudio.com/download, Eclipse at https://www.eclipse.org/ or other platforms is an easy way to create and execute in the editor that automatically compiles the Java file and runs on a terminal in the editor. Instructions are on the websites and explain the many features available. Eclipse has a cheat sheet included when you open the application to create the Hello World Application. Virtual Studio Code can implement multiple programming languages and is an IDE platform I utilize.

Open Eclipse IDE to begin the tutorial for Hello world.


                                                               Hello World Application

There are numerous ways to make your first Java program, and Hello World is the best place to start. Oracle gives you the exact code at: https://docs.oracle.com/javase/tutorial/getStarted/cupojava/win32.html that you can copy and paste directly into your choice of editor. Best of luck creating your first program in Java!

 

 

References

Oracle. (2015). Lesson: Object-oriented programming concepts (Links to an external site.). Retrieved from http://docs.oracle.com/javase/tutorial/java/concepts/index.html

Tutorials Point (Links to an external site.). (https://www.tutorialspoint.com/java/)

Eclipse https://www.eclipse.org/

VSC https://code.visualstudio.com/download

Notepad++ https://notepad-plus-plus.org/downloads/v8.4.4/


Monday, August 1, 2022

CPT 304 Operating Systems Theory & Design Week 5 Final Project.


Feature & structures of contemporary operating systems.

Describe features of contemporary operating systems and their structures

An operating system is one of the essential programs loaded as the computer booted. Beginning computers like the Z1 1936 – 1938 ran from punch card input without an operating system. Communication between the user and a system requires an operating system (Great Learning Team, 2022). Operating systems like MS-DOS use a command line operating system. Modern Operating systems like Windows, Linux, Mac OS, Android, and iOS use a graphic user interface (GUI). Other types of operating systems are Batch, Distributed, Multitasking, Network, Real-OS, and Mobile OS (Great Learning Team, 2022). The user interface, system interface, and input/output devices communicate with the operating system through hardware and software. The Kernel is the main component of an operating system and manages system resources and other vital services. The shell is the outer part of an operating system that manages the relations between the user and the operating system. It asks the user for input, interprets it for the operating system, and manages output from the system (Great Learning Team, 2022). The main functions of an operating system are process management, memory management, I/O device management, Storage and file management, Protection and security, Error detection, and application scheduling (Silberschatz, Galvin, & Gagne, 2014). The operating system provides a place to run programs, controls memory management and CPU scheduling, manage files, networks, security, user interaction, and system services. It gives programmers easy access to design new operating systems and applications (Silberschatz, Galvin, & Gagne, 2014). Operating systems are great for user I/O and help make the processing and exchange of information fast and efficient.

Discuss how operating systems enable processes to share and exchange information.

Process Execution Synchronization & Threads.


The operating system manages processes by creating new processes, scheduling processes, terminating processes, waiting on instruction or interrupting processes, and deadlock. The traffic controller assigns the processor a task and stops it when it is not needed or needs to be delayed by another process. When multithreading is utilized, multiple processes can share resources, and inter¬-process communication allows sharing memory and message passing to control buffering of processes for fast and efficient use of multiple threads. The operating system can avoid a deadlock or endless waiting state by giving notice of all needed resources before the process is executed. Process swapping helps keep waiting processes from waiting for too long. Proper parallel programming utilizes the multicores and threads unless the process is waiting on a series process like printing to a printer. However, critical problems can arise when multiple processes share the same resources and can not execute processes simultaneously. Solutions are mutual exclusion, progress requirement, and bound waiting (Silberschatz, Galvin, & Gagne, 2014). Computers have improved speed and efficiency over the years, and memory requirements have increased. Using virtual memory technics is one way to solve memory issues.

Explain how main memory and virtual memory can solve memory management issues.

Memory Management.

Dynamic Storage Memory Allocation.

Some programs may use more main memory than is necessary to run. Physical memory can be overloaded because of extra programming for security, error predicting, and other instructions that are not needed at the time. Virtual memory management can be utilized to shrink the amount of memory a program uses. If a program requires the extra programming, it can always request to have the instruction moved up the memory hierarchy and added as needed. Many memory allocation schemes can allow the best use of memory resources for future retrieving and storing of instructions and data. Virtual memory uses software and hardware to support physical memory shortages by using disk storage as a temporary storage location from random access memory (RAM). Virtual memory uses logical addresses in a memory map, segmentation paging that the user sees, but the user does not know the physical address (Silberschatz, Galvin, & Gagne, 2014). Memory management is a necessary feature of the operating system to store data and files properly.

Explain how files, mass storage, and I/O are handled in a modern computer system.

Storage Management.

Efficient file management is determined by the size of storage available, hardware speed, and software algorithms created for best file management. Files are usually stored in folders or directories. Directory logical structures determine if files can be retrieved by only one user or accessed and shared by multiple users. The file system determines who gets specific resources. It gives and takes away resources depending on what-when-why it is needed (Silberschatz, Galvin, & Gagne, 2014). The operating system is stored in permanent storage where it can be retrieved along with other applications when the computer is turned on.

The operating system looks over the input/output management to oversee the multiple devices. It determines when or if a process can control a device and for how long a period of control. It communicates the allocation and deallocation control of devices efficiently. The kernel module controls a device with software like a device driver (Silberschatz, Galvin, & Gagne, 2014). The operating system controls the devices and allows or disallows user and program access to resources for efficiency, security, and protection.

Outline the mechanisms necessary to control the access of programs or users to the resources defined by a computer system.

Security

Protection

The operating system is tasked with protecting itself and users from other users and unintended self-harm. Algorithms, software, and hardware device protocols are implemented to prevent unauthorized access to systems and information. Users have control measures of dual authentication and token devices. Correctly set firewalls, antivirus, spyware, and access permissions to information or system access can be structured to allow authorized users ease of access and unauthorized users out. Multiple layers of security, access matrixes, and policies are needed to keep unwanted access or malicious acts to confidential files or systems (Silberschatz, Galvin, & Gagne, 2014). Security and preventive protection measures can help keep systems safe and secure from attacks and accidental access while maintaining normal operations.

Recommend how you will use these concepts about operating systems theory in future courses and/or future jobs.

These concepts will help understand future coarse concepts and structures based on operation system theories. Programming future applications and systems will implement efficient safeguards and complete hardware and software utilization. Future career development can ensure a safe environment and protection from unauthorized and system infiltration. Whether working on a single system or a whole network of systems, these concepts will significantly impact everyone’s future.

References

Great Learning Team (2 February 2022) What is Operating System and Types of Operating System.              Retrieved from https://www.mygreatlearning.com/blog/what-is-operating-system/

Silberschatz, A., Galvin, P. B., & Gagne, G. (2014). Operating system concepts essentials (2nd ed.).             Retrieved from https://redshelf.com/



CPT 307 Week 5 Newbie to Newbie

Applying algorithmic design and data structure techniques creating structured programs   https://www.prepbytes.com/summer-programs/master-...