DEV Community

Roby Cigar
Roby Cigar

Posted on

1

Apa Itu Lexicographical Order?

Singkatnya, lexicographical order itu ADALAH alphabetical order.

Contoh kita punya beberapa string tidak berurutan seperti berikut:

  • adi
  • budi
  • ahmad
  • abdul

Setelah kita urutkan menggunakan lexicographical order akan menjadi seperti berikut:

  • abdul
  • adi
  • ahmad
  • budi

Note: dikarenakan adi, abdul, dan ahmad mempunyai huruf awalan yang sama yaitu "a", maka kita akan mengurutkan huruf keduanya, yaitu "d" pada adi, "b" pada abdul, "h" pada ahmad.

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay