Sign Up

Join the Codozzle community now and ask questions, share knowledge, and connect with peers and industry leaders!

Have an account? Sign In

Have an account? Sign In Now

Sign In

Log in to keep sharpening those coding skills.

Sign Up Here

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

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

Codozzle

Codozzle Logo Codozzle Logo

Codozzle Navigation

  • Home
  • About Codozzle
  • About Nallas
  • Mentors
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Codozzle
  • About Nallas
  • Mentors

General

Share
  • Facebook
6 Followers
7 Answers
6 Questions
Home/General
  • Recent Questions
  • Most Answered
  • Answers
  • No Answers
  • Most Visited
  • Most Voted
Codozzle
CodozzleCoder Grove
Asked: May 12, 2022 at 3:32pmIn: General

Move all negative elements to end

Given an unsorted array arr [] of size N having both negative and positive integers. The task is placing all negative element at the end of array without changing the order of positive element and negative element.  Note: Solution language is your choice ...Read more

Given an unsorted array arr [] of size N having both negative and positive integers. The task is placing all negative element at the end of array without changing the order of positive element and negative element. 

Note: Solution language is your choice (Java, Python, Dotnet, etc…)

Example 1:

Input:

N = 8

Arr [] = {1, -1, 3, 2, -7, -5, 11, 6}

Output:

1  3  2  11  6 -1  -7  -5

Example 2:

Input:

N=8

Arr [] = {-5, 7, -3, -4, 9, 10, -1, 11}

Output:

7  9  10  11  -5  -3  -4  -1

 

Your Task:  
You don’t need to read input or print anything. Your task is to complete the function segregate Elements () which takes the array arr [] and its size N as inputs and store the answer in the array arr [] itself.

Constraints:
1 ≤ N ≤ 105
-105 ≤ arr [] ≤ 105

Read less
  • 4
  • 122
Betty
BettyCoder Seed
Asked: May 20, 2022 at 11:23amIn: General

How does Codozzle work? What is the significance?

Read less
  • 1
  • 18
Karthi
KarthiCoder Seed
Asked: May 13, 2022 at 6:13pmIn: General

What is Unit Testing?

Read less
  • 1
  • 26
raghavendran s
raghavendran sCoder Seed
Asked: May 11, 2022 at 12:46pmIn: General

Best Coding language for starters

Which is the best coding language for starters to learn

Which is the best coding language for starters to learn

Read less
  • 1
  • 39
Shanmathi M
Shanmathi MCoder Seed
Asked: May 9, 2022 at 5:17pmIn: General

What is the connection between PROGRAMMING and MATHEMATICS?

Read less
  • 0
  • 20
Raviraja R
Raviraja RCoder Seed
Asked: May 9, 2022 at 3:50pmIn: General

What is Content Management System?

Read less
  • 0
  • 5

Sidebar

Ask A Question

Recent News & Events

  • Codozzle Contest Winner Announcement – Week 6

    Codozzle Contest Winner Announcement – Week 6

More News & Events

Stats

  • Popular
  • Answers
  • Janani Sekar

    What do you mean by Garbage collection in programming?

    • 10 Answers
  • Vani

    How is Java different from C++?

    • 6 Answers
  • Vani

    What do you understand by an instance variable and a ...

    • 6 Answers
  • Jayashree Jayabalan
    Jayashree Jayabalan added an answer Hi SAGAR, Yes sir,Python code can be slow for multitude… November 3, 2022 at 5:17am .
  • Vanitha
    Vanitha added an answer What is the role of the full stack developer and… November 1, 2022 at 8:47am .
  • Aarthi
    Aarthi added an answer C++ is both procedural and object oriented language.Java is an… November 1, 2022 at 8:47am .

Categories

Contest Dot Net Full Stack General Java Python Quality Engineering SQL

Explore

  • Home
  • Categories
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Mentors
  • Badges
  • How-To
  • Help/FAQ

Footer

About Codozzle

Codozzle is an exciting initiative of Nallas’ inclined towards the student community to motivate and help them to showcase their coding craftsmanship.

Quick Links

  • About Nallas
  • About Codozzle
  • Meet The Team
  • Badges

Help

  • How-To
  • Support
  • FAQs

Disclaimer

  • Terms of Use
  • Privacy Policy

Follow

© 2021 Codozzle - Nallas. All Rights Reserved