2 views

Uploaded by Parveen Mittal

for programing reersyrt

- CS2210 Midterm Paper 2 for Class11 2014-15 With Mark Key
- Rainflow Counting Methods
- C++ Sikhiyei (Urdu).pdf
- Cod Ility Demo
- Encapsulation Presentation
- i46debsc
- c++ Practical
- 86881171 Rainflow Counting Methods
- fortran_quick_guide.pdf
- Solution Practice Problems Array Problems
- Problems - Wissen Software Developer Hiring Challenge
- november2004paper2
- Pre Board Computer Science Set2
- 09 Array
- Introduction to c programming
- Computer Science (2016-17) Set SQP
- Lecture 12 C++
- lkjhgfds
- Lecture01.Article 5136
- Commonly Used Formulas for MS Excel

You are on page 1of 3

Given two random integer arrays, print their intersection. That is print all the

elements that are present in both the given arrays.

Input format :

Line 1 : Array 1 Size

Line 2 : Array 1 elements (separated by space)

Line 3 : Array 2 Size

Line 4 : Array 2 elements (separated by space)

Output format : Print intersection elements in different lines

2. Pair sum in array

Given a random integer array and a number x. Find and print the pairs of element

s in the array which sum to x.

While printing a pair, print the smaller element first.

That is, if a valid pair is (6, 5) print "5 6". There is no constraint that out

of 5 pairs which have to be printed on 1st line. You can print pairs in any orde

r, just be careful about the order of elements in a pair.

Input format :

Line 1 : Array size

Line 2 : Array elements

Line 3 : x

Output format :

Line 1 : Pair 1 elements (separated by space)

Line 2 : Pair 3 elements (separated by space)

Line 3 : and so on

Given a random integer array and a number x. Find and print the pairs of element

s in the array which sum to x.

While printing a pair, print the smaller element first.

That is, if a valid pair is (6, 5) print "5 6". There is no constraint that out

of 5 pairs which have to be printed on 1st line. You can print pairs in any orde

r, just be careful about the order of elements in a pair.

Input format :

Line 1 : Array size

Line 2 : Array elements

Line 3 : x

Output format :

Line 1 : Pair 1 elements (separated by space)

Line 2 : Pair 3 elements (separated by space)

Line 3 : and so on

4. Find the Unique Element

Given an integer array of size 2N + 1. In this given array, N numbers are presen

t twice and one number is present only once in the array.

You need to find that number which is unique in the array.

Note : Given array will always contain odd number of elements.

Input format :

Line 1 : Array size i.e. 2N+1

Line 2 : Array elements (separated by space)

Sample Input :

7

2 3 1 6 3 6 2

Sample Output

1

5.Sort 0 1

You are given an integer array that contains only 0s and 1s. Write a function to

sort this array. Find a solution which scans the array only once. Don't use ext

ra array.

You need to change in the given array itself. So no need to return or print anyt

hing.

Input format :

Line 1 : Array Size

Line 2 : Array elements (separated by space)

Sample Input:

7

0 1 1 0 1 0 1

Sample Output:

0 0 0 1 1 1 1

6. Sort 0 1 2

You are given an integer array containing only 0s, 1s and 2s. Write a solution t

o sort this array only in a single scan.

You need to change in the given array itself. So no need to return or print anyt

hing.

Input format :

Line 2 : Array elements (separated by space)

Sample Input:

7

0 1 2 0 2 0 1

Sample Output:

0 0 0 1 1 2 2

- CS2210 Midterm Paper 2 for Class11 2014-15 With Mark KeyUploaded bybissoon
- Rainflow Counting MethodsUploaded bypanos3
- C++ Sikhiyei (Urdu).pdfUploaded bySyed Fawad
- Cod Ility DemoUploaded byPrisco Farina
- Encapsulation PresentationUploaded byPreetVirdi
- i46debscUploaded byNitin Nigam
- c++ PracticalUploaded bySunil Trivedi
- 86881171 Rainflow Counting MethodsUploaded byFrancesco Perrone
- fortran_quick_guide.pdfUploaded byjhalendrafb
- Solution Practice Problems Array ProblemsUploaded byMnjira Abdallah
- Problems - Wissen Software Developer Hiring ChallengeUploaded byjay
- november2004paper2Uploaded byapi-3753397
- Pre Board Computer Science Set2Uploaded byAditya Kumar
- 09 ArrayUploaded byAgusDasSusanto
- Introduction to c programmingUploaded byAbhishek Saxena
- Computer Science (2016-17) Set SQPUploaded byAkhiJarodia
- Lecture 12 C++Uploaded byMehmood Khan Marwat
- lkjhgfdsUploaded byCristina Larisa
- Lecture01.Article 5136Uploaded byMohamed EL-Fayomy
- Commonly Used Formulas for MS ExcelUploaded bynurul000
- 9 arrayUploaded bylunding
- SKA L07_ Arrays, Doc Comment.pptxUploaded byHorror Talk
- IP Manual#12 1D array.pdfUploaded byKamran
- MATLAB_Basics_2.pdfUploaded byShweta Sridhar
- 0309CG3-DataAnalysisUploaded byever2point0
- ArraysUploaded bykishorinaren
- TS-6 Structure and Dynamic Memory AllocationUploaded byPareen5
- CSCE204-Lecture18Uploaded bynoblelion
- Data Structure 1Uploaded byHasanen10
- staticrepresentation of list data structureUploaded byहितेश Pande

- cowmaaUploaded byParveen Mittal
- Operation LogUploaded byParveen Mittal
- output2Uploaded byParveen Mittal
- Windows10UpgradeVersion.txtUploaded byParveen Mittal
- MIT6_006F11_lec14Uploaded byZorzallibre
- Install EnglishUploaded byFajar Ramdhani
- Windows 10 Upgrade VersionUploaded byParveen Mittal
- Advanced Data Structures.pdfUploaded byDo Hong Cam
- About ApacheUploaded byTati Dias
- Installer LicenseUploaded bybortolaco
- ReadmeUploaded byParveen Mittal
- cowmaa.txtUploaded byParveen Mittal
- loppolpolp.txtUploaded byParveen Mittal
- pkmittaloops.txtUploaded byParveen Mittal
- Pk Mittal OopsUploaded byParveen Mittal
- Piracy MadeeasyUploaded byParveen Mittal
- reffrigratorUploaded byParveen Mittal
- FM GENUploaded byParveen Mittal
- RevisionsUploaded byParveen Mittal
- PpsUploaded byParveen Mittal
- dd_vs_bootstrapper (1)_decompression_log.txtUploaded byParveen Mittal
- AppInsights_VisualStudioUploaded byParveen Mittal
- ProjecTUploaded byParveen Mittal
- Project OverviewUploaded byParveen Mittal
- Dd vs Community 20161229012715 167 Netfxfullredist 43.Log 000 Netfx 461mtpack.msiUploaded byParveen Mittal
- dd_vs_bootstrapper_decompression_log.txtUploaded byParveen Mittal
- Jntuworld.com [JW]Uploaded byNavarshi Vishnubhotla
- Dd vs Community 20161229012715 167 Netfxfullredist 43.LogUploaded byParveen Mittal

- SimpleScalar SimulationsUploaded byFishStik
- Sansi OriginalUploaded byRebeca Campos Ferreira
- Witcher NextUploaded byHunter Quinn
- Symbolic Consumption and Identity constructionUploaded byDaniel Hein Mikkelsen
- resumefoundationUploaded byapi-252409952
- Work of BreathingUploaded byabc007200
- The Information Literacy User's GuideUploaded byMAS
- Exhaustive LSMW TutorialUploaded byankushlokhande
- Your Health - 21 October 2014Uploaded byTimes Media
- Anti Fungal in BreadUploaded byRufa Lara Mendez
- Strategies for Teaching FractionsUploaded byNaty Durán
- Uncertainties Python PackageUploaded bybrouwerfan
- ABAP Guidelines3Uploaded byConeti
- Metadata Repository Manager Semantic Architect in Denver CO Resume Kim BareUploaded byKimBare
- Diamond.marks - Seymour Martin Lipset and the Study of DemocracyUploaded byLozonschi Alexandru
- 1 arnes.pdfUploaded byAnonymous goIn6wA3K
- Africa vs Caltex 16 Scra 448Uploaded bycatherinesulapas5673
- CHARLES D. CUTTLER. "Northern Painting. From Pucelle to Bruegel-Fourteenth, Fifteenth, And Sixteenth Centuries"Uploaded byEdgar Ulloa
- The Role of MPAs in Reconciling Fisheries Management With Conservation of Biological DiversityUploaded byMarie
- From the Mute God to the Lesser GodUploaded byefunction
- Hydraulic Gradient Stat in Stoch Earth DamUploaded byfcv007
- DipPM MPA Course DescriptionUploaded bycreamyfrappe
- Gillman.pdfUploaded byHery Purwanto
- An Intro to Fill and Backfill for StructuresUploaded byBobby
- 223706329-Concrete-Mix-Design.xlsUploaded byTri Angga Dio Simamora
- Subjects and Topics in Basic Medical Science: A Imhotep Virtual Medical School PrimerUploaded byMarc Imhotep Cray, M.D.
- Final Presentation for Mam MatildoUploaded byPrince Joseph Hortilano
- Module 7 (Hazwan)Uploaded byapi-3761213
- Excerpt from "The End of Karma" by Somini Sengupta.Uploaded byOnPointRadio
- tayey1Uploaded byEdgielyn Pancho