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
Nuetrik [128]
3 years ago
14

Write a static method named contains that accepts two arrays of integers a1 and a2 as

Computers and Technology
1 answer:
pashok25 [27]3 years ago
5 0

Answer:

Sew explaination foe code

Explanation:

import java.lang.*;

import java.util.*;

import java.io.*;

class Main

{

public static Boolean checkSubset(int[] list1, int[] list2)

{

int l = list2.length;

for(int i = 0; i<list1.length-l; i++)

{

Boolean flag = true;

for(int j = 0; j<list2.length; j++)

{

if(list1[i+j] != list2[j])

{

flag = false;

break;

}

}

if(flag) return true;

}

return false;

}

public static void main(String args[])

{

int[] l1 = {1,6,2,1,4,1,2,1,8};

int[] l2 = {1,2,2};

System.out.println(checkSubset(l1,l2));

}

}

You might be interested in
Write a program to demonstrate circular linked list with operations using pointers – insert
BabaBlast [244]

A program to demonstrate circular linked list with operations using pointers is:

struct Node *addToEmpty(struct Node *last, int data)

{

   // This function is only for empty list

   if (last != NULL)

     return last;

 

   // Creating a node dynamically.

   struct Node *temp =

         (struct Node*)malloc(sizeof(struct Node));

 

   // Assigning the data.

   temp -> data = data;

   last = temp;

   // Note : list was empty. We link single node

   // to itself.

   temp -> next = last;

 

   return last;

}

<h3>What is a Circular Linked List?</h3>

This refers to the type of linked list in which the first and the last nodes are also joined together other to form a circle

Read more about circular linked list here:

brainly.com/question/12974434

#SPJ1

5 0
1 year ago
How do I mirror cast my smart lg tv?​
lora16 [44]
I really wish I could help you but I don’t know
6 0
3 years ago
What are paragraphs separated by
Lemur [1.5K]

Paragraphs are usually separated by blank space.

Hope this is what you were looking for :)

6 0
3 years ago
True or false
Semmy [17]
It’s false I hope this helped you
3 0
3 years ago
Low-level programming languages are considered closer to human languages, making them easier for programmers to learn and use.
zubka84 [21]
I think the answer is True I hope it helps
4 0
3 years ago
Other questions:
  • Which graphic design tool allows you to lay images on top of one another? A. Layers B. Selection C. Drawing D. Color
    10·2 answers
  • What two terms below describe a network device with three ports, two of which send and receive all traffic, and the third port m
    6·1 answer
  • Brainliest to whoever can guess what year this corvette logo is from. Make your guesses
    11·1 answer
  • Which of the following Google tools support collaboration? Docs Sheets Slides All of the Above
    13·1 answer
  • Why is it important to protect people's intellectual property online?
    10·1 answer
  • You are a network engineer tasked with performing a site survey for a multiple-channel architecture (MCA) system in a three-stor
    11·1 answer
  • Microsoft Excel is an example of a(n) application.
    11·2 answers
  • Please help it’s timed
    5·1 answer
  • Use the drop-down menus to complete each statement. Two main versions of Outlook are the desktop app and the app. The has limite
    15·2 answers
  • Microsoft recommends when that you create passwords with upper and lowercase letters, numbers, symbols, and use at least _______
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!