home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!news.funet.fi!hydra!klaava!wirzeniu
- From: wirzeniu@klaava.Helsinki.FI (Lars Wirzenius)
- Newsgroups: comp.lang.c
- Subject: Re: How can one make a dynamic array?
- Message-ID: <1992Sep3.131522.18879@klaava.Helsinki.FI>
- Date: 3 Sep 92 13:15:22 GMT
- References: <aphaswan.1.0@cs1.uct.ac.za>
- Organization: University of Helsinki
- Lines: 15
-
- aphaswan@cs1.uct.ac.za (AK PHASWANA) writes:
- >Most sorting procedures like bubble sort, bisection method, merge sort,
- >use arrays. The problem with arrays is that they are not dynamic.
-
- You can change the size of a dynamically allocated array in C. Read
- your friendly manual about malloc, calloc, realloc and free.
-
- >Or is there any way of implementic sorting and searching procedures
- >without using arrays?
-
- You can sort lists pretty well with mergesort, or use automatically
- sorted data structures such as some trees.
-
- --
- Lars.Wirzenius@helsinki.fi
-