Programming Homework Help

Alabama Aviation College Stack Data Structure and VS Code Answer Project

 

Ques 12.

Open the attached document to each question up in VS code answer and edit errors. Follow the instructions

Que 13
there are errors in the index.html file as well as in the second file attached. Begin debugging the index.html file, there will be instructions in the comments. Next, take a look at the script.js file.

Ques 14

Open the attached document to each question up in VS code answer and edit errors. Follow the instructions

Ques 15

errors in the file attached correct them in

Ques 16

download Eclipse for this work below:

In this assignment, you will implement a Stack data structure.

Instructions

For this assignment, you will implement a Stack data structure. A stack can be implemented in several different ways. It is not inherently a node-based data structure, but you could implement it using nodes if you like.

The most important thing to remember with stacks is the way they push, pop, and peek data.

  • push() : adds an element to the top/front of the stack
  • pop() : removes the first element from the stack, and returns it.
  • peek() : returns the first element from the stack without removing it.

Your stack should be able to support all of these functions. For example, you might have something like the following:

public class Stack {
    private Node top;

    public void push(Node newNode) {
        // your implementation here
    }
    public Node pop() {
        // your implementation here
    }
    public Node peek() {
        // your implementation here
    }
} 
 Ques 17 download Eclipse for this work below
Instructions

For this task, you will have to implement a Linked List, which is a node-based data structure. This will be easier than it seems. Recall that a node-based data structure is simply a collection of "node" objects. Each node object contains a reference to one or more other nodes, and a bit of data. Thus, your node might look like this:
public class Node {
    Node next;
    Integer data;
}
Of course, if you wanted to use generics, you could create a generic Node class which used the generic type for the "data" variable too.
A LinkedList Class might then look like this:
public class LinkedList { 
    Node head;
    
    // utility methods
}A node for a Linked List might be improved by having an "add()" method with special behavior: when invoked, the "add()" method will traverse the linked list to add a given node to the end of the list.
algorithm add is:
    input: Node newNode -> The new node to add
    
    let "currentNode" = head;
    while current.next != null
        current = current.next

    current.next = newNode