Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

please use c++ to solve this dont warry about data I just need the function. she

ID: 3667378 • Letter: P

Question

please use c++ to solve this

dont warry about data I just need the function.

shell(gap1,gap2,gap3,...) : Sorts the current array using shell sort and displays the results ON ONE LINE. Duplicate the array before sorting it, so that the original remains the same. In other words duplicate current newArr and sort newArr. See information in the notes section about how you need to display the sorted array contents.

Run the shell sort first using the first gap value, then the second, then the third, and so on until you've sorted using all specified gap values.

You may NOT assume that the last gap value will always be 1. While this IS required to do a proper sort, the grading process is going to test whether or not your interleaved list sorting logic is correct. So in response to this command you may end up displaying certain lists that are not actually fully sorted.

There will be at least 1 gap value, but no limit to how many gap values there will be total. The last gap value does not have a comma after it, just the closing ')' character.

Explanation / Answer

gap> v:= GF(2)^2; v.name:= "v";; RowSpace( GF(2), [ [ Z(2)^0, 0*Z(2) ], [ 0*Z(2), Z(2)^0 ] ] ) gap> SemiEchelonBasis( v ); SemiEchelonBasis( v, [ [ Z(2)^0, 0*Z(2) ], [ 0*Z(2), Z(2)^0 ] ] ) gap> b:= Basis( v, [ [ 1, 1 ], [ 0, 1 ] ] * Z(2) ); Basis( v, [ [ Z(2)^0, Z(2)^0 ], [ 0*Z(2), Z(2)^0 ] ] ) gap> IsSemiEchelonBasis( b ); true gap> b; SemiEchelonBasis( v, [ [ Z(2)^0, Z(2)^0 ], [ 0*Z(2), Z(2)^0 ] ] ) gap> Coefficients( b, [ 0, 1 ] * Z(2) ); [ 0*Z(2), Z(2)^0 ] gap> Coefficients( b, [ 1, 0 ] * Z(2) ); [ Z(2)^0, Z(2)^0 ]

gap> v:= GF(2)^2; v.name:= "v";; RowSpace( GF(2), [ [ Z(2)^0, 0*Z(2) ], [ 0*Z(2), Z(2)^0 ] ] ) gap> b1:= Basis( v, [ [ 0, 1 ], [ 1, 0 ] ] * Z(2) ); Basis( v, [ [ 0*Z(2), Z(2)^0 ], [ Z(2)^0, 0*Z(2) ] ] ) gap> IsSemiEchelonBasis( b1 ); true gap> b1; SemiEchelonBasis( v, [ [ 0*Z(2), Z(2)^0 ], [ Z(2)^0, 0*Z(2) ] ] ) gap> b2:= Basis( v, [ [ 0, 1 ], [ 1, 1 ] ] * Z(2) ); Basis( v, [ [ 0*Z(2), Z(2)^0 ], [ Z(2)^0, Z(2)^0 ] ] ) gap> IsSemiEchelonBasis( b2 ); false gap> b2; Basis( v, [ [ 0*Z(2), Z(2)^0 ], [ Z(2)^0, Z(2)^0 ] ] )

gap> G := Group( [ (1,2), (2,3), (3,4) ], () ); Group( (1,2), (2,3), (3,4) ) gap> S:=Subgroup( G, [ (1,2), (3,4) ] ); Subgroup( Group( (1,2), (2,3), (3,4) ), [ (1,2), (3,4) ] ) gap> G.name := "G";; S.name := "S";; # to avoid warnings gap> Display( InductionTable( S, G ) ); Induction from S to G |X.1 X.2 X.3 X.4 _____________________ X.1 | 1 . . . X.2 | . . . 1 X.3 | 1 . . 1 X.4 | . 1 1 1 X.5 | 1 1 1 . gap> G := CoxeterGroup( "G", 2 );; gap> S := ReflectionSubgroup( G, [ 1, 4 ] ); ReflectionSubgroup(CoxeterGroup("G",2), [ 1, 4 ]) gap> t := InductionTable( S, G ); InductionTable( ReflectionSubgroup(CoxeterGroup("G",2), [ 1, 4 ]), CoxeterGroup("G",2)) gap> Display( t ); Induction from A1x~A1 to G2 | 11,11 11,2 2,11 2,2 ________________________________ phi{1,0} | . . . 1 phi{1,6} | 1 . . . phi{1,3}’ | . 1 . . phi{1,3}’’ | . . 1 . phi{2,1} | . 1 1 . 1482 CHAPTER 90. CHEVIE UTILITY FUNCTIONS phi{2,2} | 1 . . 1 The Display and Format methods take the same arguments as the FormatTable method. For instance to select a subset of the characters of the subgroup and of the parent group, one can call gap> Display( t,rec( rows := [5], columns := [3,2] ) ); Induction from A1x~A1 to G2 | 2,11 11,2 ____________________ phi{2,1} | 1 1 It is also possible to get TeX and LaTeX output, see 91.5. This function requires the package ”chevie”(see 56.1). 90.19 CharRepresentationWords CharRepresentationWords( rep , elts ) given a list rep of matrices corresponding to generators and a list elts of words in the generators it returns the list of traces of the corresponding representation on the elements in elts. gap> H := Hecke(CoxeterGroup( "F", 4 ));; gap> r := ChevieClassInfo( Group( H ) ).classtext;; gap> t := HeckeReflectionRepresentation( H );; gap> CharRepresentationWords( t, r ); [ 4, -4, 0, 1, -1, 0, 1, -1, -2, 2, 0, 2, -2, -1, 1, 0, 2, -2, -1, 1, 0, 0, 2, -2, 0 ] This function requires the package ”chevie”(see 56.1). 90.20 PositionClass PositionClass( G, c ) G must be a domain for which ConjugacyClasses is defined and c must be an element of G. This functions returns a positive integer i such that c in ConjugacyClasses( G )[i]. gap> G := Group( (1,2)(3,4), (1,2,3,4,5) );; gap> ConjugacyClasses( G ); [ ConjugacyClass( Group( (1,2)(3,4), (1,2,3,4,5) ), () ), ConjugacyClass( Group( (1,2)(3,4), (1,2,3,4,5) ), (3,4,5) ), ConjugacyClass( Group( (1,2)(3,4), (1,2,3,4,5) ), (2,3)(4,5) ), ConjugacyClass( Group( (1,2)(3,4), (1,2,3,4,5) ), (1,2,3,4,5) ), ConjugacyClass( Group( (1,2)(3,4), (1,2,3,4,5) ), (1,2,3,5,4) ) ] gap> g := Random( G ); (1,2,5,4,3) gap> PositionClass( G, g ); 5 This function