protected String read_zigzag(char[][] block, int[] num_key,boolean row)
	{
		StringBuilder sb=new StringBuilder();
		if(row)
		{
			for(int i=1;i<=num_key.length;i++)
			{
				int pos=Generic_Func.search_index(num_key, i, 0);
				for(int j=0;j<block[pos].length;j++)
				{
					if(block[pos][j]!='\0')
						sb.append(block[pos][j]);
				}
				
			}
		}
		else//column
		{
			for(int i=1;i<=num_key.length;i++)
			{
				int pos=Generic_Func.search_index(num_key, i, 0);
				for(int j=0;j<block.length;j++)
				{
					if(block[j][pos]!='\0')
						sb.append(block[j][i]);
				}
				
			}
		}
		return sb.toString();
	}