Skip to main content

Posts

Pop and Peek Operations | Java Script

  Lysecky states, "Pop and Peek operations should not be applied to an empty stack because the resulting behavior may be undefined." In this Post, I will explain whether I think it's a problem and justify my answer with a citation from credible resources. Before we start, let's see what the Pop and Peek Operation is. According to an article from cs.lmu.edu, a stack implementation usually has three methods, push, pop, and peek. Push will let you add a single item onto the stack. Peek allows the user to see what value is on top of the stack, and pop allows the user to remove the top value from the stack. I support lysecky's statement because the stack is an abstract structure in which a location is set aside to keep a stack of items, and we can get to elements one by one, starting from the top. In technical terms, it follows LIFO or the last in, first out approach. So, in the stack, we can only get to the top item, and the last item we have added to it will be...

How to apply algorithmic design and data structure techniques in developing structured programs

Hi Newbie,  I will explain how to apply algorithmic design and data structure techniques in developing structured programs in this interactive assignment. So, there are a different number of data structures, and each has a different field of application and a different implementation with a different type of use. The correct data structure has to be used in the right problem-solving. For example - if the elements with a value greater or lesser than a given element have to be searched, then a binary tree has to be used neither stack nor queue. But some data structure designs are designed to occupy less space than the solutions with the other data structures and the large constants, which are hidden in asymptotic space bounds. So in such a case where the design has to be efficient for the space, more concise data structures can be used. As every program has a different statement and every statement is required to be executed, it is usual that the program will take a specific time to ...

Helpful guide for Java installation and concepts

In today's post, I will guide your Java installation and discuss the concepts and features of object-oriented design principles. To get started, let's see what exactly Java is. According to many sources, such as Oracle, techopedia, Java is an object-oriented programming language that produces software for multiple platforms. When a programmer writes a Java application, the compiled code (known as bytecode) runs on most operating systems (OS), including Windows, Linux, and Mac OS. The first step in learning Java is downloading it and a code editor, such as IntelliJ IDEA, Eclipse, NetBeans, etc., on your computer to access the platform to write/run your codes. For the most part, you can use this link to download and install Java https://www.oracle.com/java/technologies/downloads/ and that one https://www.jetbrains.com/idea/download/#section=windows for an IDEA (IntelliJ). When you hear people talking about Object-oriented programming (OOP), they're referring to a computer p...

The difference between explicit typed variables and implicit typed variables using examples.

  In this discussion we’re talking about variables, and the difference between explicit typed variables and implicit typed variables. So, I think it’s essential to find out what exactly is a variable? According to our text book, a variable is used to remember a value for later use. For example; Years is a variable which I can assign a value such as 10 to.   (Years = 10).   Python has two type of conversions. explicit type conversion and implicit type conversion. Explicit conversion, is when the user instructs the program to convert the data type to another data type, while implicit type conversion is when the interpreter knows what the conversion should be and does it for you automatically. Here is an example of explicit type variable conversion: num_int = 25 num_str = 15 print(“data type of num_int :”, type( num_int )) print(“data type of num_str :”, type( num_str ))   num_str = int (num_str) print(“data type of num_str after casting:” , type( nu...

Tech Topic Connection

  The Tech Topic I chose was Hardware components of the computer system. This topic relates to information technology and computer science concepts because so many hardware-related aspects of a computer contribute to computer performance. As we all know, a computer system comprises the hardware and software components necessary to support its operation. Therefore, it’s essential to remember that computer hardware components refer to the different pieces that make a computer. I often compare the hardware components of a computer to the different organs that work together to create a human being. It’s important to mention that computers rely on hardware and software to function correctly. When speaking of hardware components of a computer system, people always refer to the Motherboard, CPU, RAM, IO system, power supply, video display controller, Bus, and hard disk drive as the most essential. In reality, there are many hardware components. Computer Operating systems are programs ...