[Tex/LaTex] proportional boxes in Tikz (array diagram)

tikz-pgf

I am trying to do a array diagram with Tikz. So far, my results looks like this:

As you can see, I have two problems: The boxes are proportional to the content of the node and I do not have a overall box size.(Take the last three boxes as example) Furthermore, the text "k-elements" is between the array diagram and brace. It should be below brace.

Code:

\begin{tikzpicture}
  [
  -{Stealth[length=2.5pt]},
MyStyle/.style={draw, text width=25pt, text height=10pt, text centered},
my arrow/.style={shape=single arrow, rotate=90, inner sep=5pt, outer sep=0pt, single arrow head extend=0pt, minimum height=7.5pt, text width=0pt, draw=blue!50, fill=blue!25}
  ]
\begin{scope} [start chain, node distance=0pt]
\node [MyStyle,on chain] (1) {$1$};
\node [MyStyle,on chain] (2) {$2$};
\node [MyStyle,on chain] (3) {$3$};
\node [MyStyle,on chain] (4) {$4$};
\node [MyStyle,on chain] (5) {$\cdots$};
\node [MyStyle,on chain] (6) {$k$};
\node [MyStyle,on chain] (7) {$\cdots$};
\node [MyStyle,on chain] (8) {$n-2$};
\node [MyStyle,on chain] (9) {$n-1$};
\node [MyStyle,on chain] (10) {$n$};
\end{scope}
  \draw (1.north) [out=25, in=155] to (2.north);
  \draw (1.north) [out=30, in=155] to (3.north);
  \draw (1.north) [out=35, in=155] to (4.north);
  \draw (1.north) [out=40, in=155] to (6.north);
  \draw [decorate,decoration={brace,amplitude=10pt,mirror},xshift=-4pt,yshift=0pt]
  (0.7,-0.27) -- (6.6,-0.27)node[black,midway,xshift=9pt] {$k$-elements} ;
\end{tikzpicture}

(code is based on Array with arrows and a cell outside and Draw Curly Braces in TikZ )

And a other questions: Is there a good introduction to Tikz? Or is the Documentation the best starting point?

Thank you guys for the help!

Best Answer

Testing new editor for LaTeX I was to late with my answer. It is almost the same as from @ferahfeza. The tiny differences are in definition of arrows and brace:

\documentclass[tikz,margin=10pt]{standalone}
    \usetikzlibrary{arrows.meta,chains,%
                    decorations.pathreplacing}

    \begin{document}
\begin{tikzpicture}[
%  -{Stealth[length = 2.5pt]},
       start chain = going right,
     node distance = 0pt,
MyStyle/.style={draw, minimum width=2em, minimum height=2em, 
                outer sep=0pt, on chain},
  ]
\node [MyStyle] (1) {$1$};
\node [MyStyle] (2) {$2$};
\node [MyStyle] (3) {$3$};
\node [MyStyle] (4) {$4$};
\node [MyStyle] (5) {$\cdots$};
\node [MyStyle] (6) {$k$};
\node [MyStyle] (7) {$\cdots$};
\node [MyStyle] (8) {$n-2$};
\node [MyStyle] (9) {$n-1$};
\node [MyStyle] (10) {$n$};
\begin{scope}[-{Stealth[length = 2.5pt]}]
  \draw (1.north) [out=25, in=155] to (2.north);
  \draw (1.north) [out=30, in=155] to (3.north);
  \draw (1.north) [out=35, in=155] to (4.north);
  \draw (1.north) [out=40, in=155] to (6.north);
\end{scope}
\draw[decorate,decoration={brace, amplitude=10pt, raise=5pt, mirror}]
  (2.south west) to node[black,midway,below= 15pt] {$k$-elements} (7.south east);%
\end{tikzpicture}
    \end{document}

A naming of nodes with numbers is not good idea, in some circumstances can cause unexpected errors.

enter image description here

For learning TikZ read chapter "TikZ is kein Zeichenprogramm" in TikZ manual. There is some sort summary of (very lengthy) TikZ manual. Informative are also examples provided in http://www.texample.net/