1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
OLga [1]
3 years ago
12

Extend the class linkedListType by adding the following operations: Write a function that returns the info of the kth element of

the linked list. If no such element exists, terminate the program. Write a function that deletes the kth element of the linked list. If no such element exists, terminate the program.
Computers and Technology
1 answer:
WINSTONCH [101]3 years ago
6 0

Answer:

Explanation:

The following code is written in Java. Both functions traverse the linkedlist, until it reaches the desired index and either returns that value or deletes it. If no value is found the function terminates.

public int GetNth(int index)

       {

       Node current = head;

       int count = 0;

       while (current != null)

       {

       if (count == index)

       return current.data;

       count++;

       current = current.next;

       }

       assert (false);

       return 0;

       }

public int removeNth(int index)

       {

       Node current = head;

       int count = 0;

       while (current != null)

       {

       if (count == index)

       return current.remove;

       count++;

       current = current.next;

       }

       assert (false);

       return 0;

       }

You might be interested in
Plz help meeeeee QUICKLY!!! WORTH 15 POINTS!
Lady bird [3.3K]

Answer:

Im pretty sure Domain name system but dont trust me

Explanation:

8 0
4 years ago
Two types of binocular depth cues are __________ and __________.
OverLord2011 [107]
Binocular depth cues are the 'things' that help us to judge distance. The two main ones that relate to binocular vision are:

1. Convergence.
This is the fact that as we get closer to an object, our eyes begin to point inward to remain focused on the object. I.e. we go cross eyed. 

2. Disparity
This is the fact that our eyes both see a different image when focused on an object because they are actually looking at it from a different perspective (about 6 centimeters apart). This disparity changes based on the object distance from the observer so is also a cue used by our brain to judge distance.
4 0
3 years ago
Give ways on how to effectively save.​
sp2606 [1]

Answer:

Explanation:

say goodbye to debt. Monthly debt payments are the biggest money suck when it comes to saving. ...

Cut down on groceries. ...

Cancel automatic subscriptions and memberships.

4 0
3 years ago
True/False: A datasum can be generated for any width of data. For example, we can create an 8, 16, or 32 bit datasum for 8, 16,
Zolol [24]

Answer:

true

Explanation:

6 0
3 years ago
Write a C++ program to build a simple calculator<br>(+،-،*،/) using switch statement?​
Mars2501 [29]

Answer:

Check explanation

Explanation:

# include <iostream>

using namespace std;

int main()

{

   char op;

   float a, b;

   cout << "Enter operator either + or - or * or /: ";

   cin >> op;

   cout << "Enter two operands: ";

   cin >> num1 >> num2;

   switch(op)

   {

       case '+':

           cout << a + b;

           break;

       case '-':

           cout << a - b;

           break;

       case '*':

           cout << a * b;

           break;

       case '/':

           cout << a / b;

           break;

       default:

           cout << "This operator is not valid. Please try again.";

           break;

   }

   return 0;

}

4 0
3 years ago
Other questions:
  • When searching for an image on your computer, you should look for a file with which of the following extensions?
    6·1 answer
  • Out of the following guidlines which should you use when writing a memo?
    10·2 answers
  • which option of the AutoCorrect tool enables you to add and delete words that do not follow abbreviation rules?
    10·2 answers
  • Is mmorpg an example of virtual community
    5·2 answers
  • These operating systems were referred to as command-based.
    12·1 answer
  • Linela Insurance needs to hire twenty accountants immediately to support its accounts receivable process. The hiring and trainin
    7·1 answer
  • Kelly completes a bachelor's degree in animation from a top school in New York. She would now like to look for a job that will p
    5·2 answers
  • What is the useful chart used for comparing values over categories?​
    8·1 answer
  • Someone say crackhead
    15·2 answers
  • There is a group of 10 people who are ordering pizza. If each person gets 2 slices and each pizza has 5 slices, how many pizzas
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!