Sign Up

Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have permission to ask a question, You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here
Sign InSign Up

SIKSHAPATH

SIKSHAPATH Logo SIKSHAPATH Logo

SIKSHAPATH Navigation

  • Home
  • Questions
  • Blog
    • Computer Science(CSE)
    • NPTEL
    • Startup
  • Shop
    • Internshala Answers
Search
Ask A Question

Mobile menu

Close
Ask A Question
  • Home
  • Questions
  • Blog
    • Computer Science(CSE)
    • NPTEL
    • Startup
  • Shop
    • Internshala Answers
  • About
    1. Asked: November 14, 2021In: Other

      Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.

      Professor
      Professor
      Added an answer on November 14, 2021 at 8:54 pm

      //YOU CAN ALSO USE FOLLOWING CODE: import java.util.HashMap; import java.util.Scanner; import java.util.Map; class TwoSum { // Time complexity: O(n) private static int[] findTwoSum(int[] nums, int target) { Map numMap = new HashMap(); for (int i = 0; i < nums.length; i++) { int complement = targeRead more

      
      //YOU CAN ALSO USE FOLLOWING CODE:
      
      import java.util.HashMap;
      import java.util.Scanner;
      import java.util.Map;
      
      class TwoSum {
          // Time complexity: O(n)
              private static int[] findTwoSum(int[] nums, int target) {
                      Map numMap = new HashMap();
                              for (int i = 0; i < nums.length; i++) {
                                          int complement = target - nums[i];
                                                      if (numMap.containsKey(complement)) {
                                                                      return new int[] { numMap.get(complement), i };
                                                                                  } else {
                                                                                                  numMap.put(nums[i], i);
                                                                                                              }
                                                                                                                      }
                                                                                                                              return new int[] {};
                                                                                                                                  }
                                                                                                                                  }
      
      
      
      
      
      See less
        • 2
      • Share
        Share
        • Share on WhatsApp
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
    2. Asked: November 14, 2021In: Other

      Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.

      Professor
      Professor
      Added an answer on November 14, 2021 at 8:52 pm

      import java.util.HashMap; import java.util.Scanner; import java.util.Map; class TwoSum { private static int[] findTwoSum_BruteForce(int[] nums, int target) { for (int i = 0; i < nums.length; i++) { for (int j = i + 1; j < nums.length; j++) { if (nums[i] + nums[j] == target) { return new int[]Read more

      
      
      import java.util.HashMap;
      import java.util.Scanner;
      import java.util.Map;
      
      class TwoSum {
      
          
              private static int[] findTwoSum_BruteForce(int[] nums, int target) {
                      for (int i = 0; i < nums.length; i++) {
                                  for (int j = i + 1; j < nums.length; j++) {
                                                  if (nums[i] + nums[j] == target) {
                                                                      return new int[] { i, j };
                                                                                      }
                                                                                                  }
                                                                                                          }
                                                                                                                  return new int[] {};
                                                                                                                      }
      
          public static void main(String[] args) {
                  Scanner keyboard = new Scanner(System.in);
              int n = keyboard.nextInt();
                      int[] nums = new int[n];
              for(int i = 0; i < n; i++) {
                          nums[i] = keyboard.nextInt();
                                  }
                                          int target = keyboard.nextInt();
              keyboard.close();
              int[] indices = findTwoSum_BruteForce(nums, target);
              if (indices.length == 2) {
                          System.out.println(indices[0] + " " + indices[1]);
                                  } else {
                                              System.out.println("No solution found!");
                                                      }
                                                          }
                                                          }
      
      
      
      
      See less
        • 0
      • Share
        Share
        • Share on WhatsApp
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
    3. Asked: November 10, 2021In: DBMS

      Create a package named as INFO which contains procedure that is passed a student’s identification number and return student’s full name and phone number from the student table to the calling program and function, pass a department number to it. If the DEPT table does not contain the department number, return a FALSE value otherwise return a TRUE value. Print the appropriate message to the calling program.

      Professor
      Professor
      Added an answer on November 14, 2021 at 7:42 pm

      https://sikshapath.in/question/solve-the-below-problem-as-soon-as-possible/

      Solve the below problem as soon as possible

      See less
        • 0
      • Share
        Share
        • Share on WhatsApp
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
    4. Asked: November 11, 2021In: DBMS

      dbms-Create a package named as INFO which contains procedure that is passed a student’s identification number and return student’s full name and phone number from the student table to the calling program and function, pass a department number to it. If the DEPT table does not contain the department number, return a FALSE value otherwise return a TRUE value. Print the appropriate message to the calling program.

      Professor
      Professor
      Added an answer on November 14, 2021 at 7:41 pm

      https://sikshapath.in/question/solve-the-below-problem-as-soon-as-possible/

      Solve the below problem as soon as possible

      See less
        • 0
      • Share
        Share
        • Share on WhatsApp
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
    5. Asked: November 12, 2021In: DBMS

      data base

      Professor
      Professor
      Added an answer on November 14, 2021 at 7:41 pm

      https://sikshapath.in/question/solve-the-below-problem-as-soon-as-possible/

      Solve the below problem as soon as possible

      See less
        • 0
      • Share
        Share
        • Share on WhatsApp
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
    6. Asked: November 13, 2021In: DBMS

      Create a package which contains a procedure to accept a text and to check whether it is palindrome or not.

      Professor
      Professor
      Added an answer on November 14, 2021 at 7:39 pm

      https://sikshapath.in/question/create-a-package-which-contains-a-procedure-to-accept-a-text-and-to-check-whether-it-is-palindrome-or-not-2/

      Create a package which contains a procedure to accept a text and to check whether it is palindrome or not.

      See less
        • 0
      • Share
        Share
        • Share on WhatsApp
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
    1 … 4 5 6 7 8 … 26

    Sidebar

    store ads

    Stats

    • Questions 1k
    • Answers 1k
    • Posts 149
    • Best Answers 89
    • This Free AI Tool Translates Entire Books in Minute !
    • AI News: 🎬 Hollywood’s AI Studios, 🎓 OpenAI’s Latest Gift to Educators, 🚚 Class8 Bags $22M, 🧠 Google Gemini’s Memory Upgrade
    • AI NEWS: Legal Action Against OpenAI, $16M Paid, & Elon Musk’s Praise from Investor 🤖💰📑 | AI Boosts Cloud Seeding for Water Security 🌱💧
    • AI News: 🎬AI Video Tool Scam Exposed🤯, 🛰️ AI-Powered Drones to Ukraine 😱, Google’s $20M AI Push, Sam Altman Joins SF’s Leadership Team
    • AI News: 🤝 Biden Meets Xi on AI Talks, 💡 Xavier Niel’s Advice for Europe, ♻️ Hong Kong’s Smart Bin Revolution, 🚀 AI x Huawei

    Explore

    • Recent Questions
    • Questions For You
    • Answers With Time
    • Most Visited
    • New Questions
    • Recent Questions With Time

    Footer

    SIKSHAPATH

    Helpful Links

    • Contact
    • Disclaimer
    • Privacy Policy Notice
    • TERMS OF USE
    • FAQs
    • Refund/Cancellation Policy
    • Delivery Policy for Sikshapath

    Follow Us

    © 2021-24 Sikshapath. All Rights Reserved