Sie sind auf Seite 1von 4

CENTRAL INDIA INSTITUTE OF MANAGEMENT STUDIES

Question Paper
Subject - Data Structures & Algorithms
Maximum Marks: 100

Important Note All questions are compulsory.

Q-1) What is the speed & real speed of a Processor? How to find the same?
Ans= processor speed
When you purchase a computer the processor speed is the most important thing to look for. Many people will say
that RAM or hard drive stats are more important, but a computer can have 5GB of RAM but a slow processor and you
still wont get a lot done. Think of the processor speed as the brain speed of your PC. If you think slowly the answers
and responses you give will be slow. But if you are up to date and fast, everything will be processed and output much
faster. If you like gaming, watching or streaming movies, and doing a lot at once then fast processor speeds are what
you need.
Computers with slow processors are likely to not last for a few years. Moderately fast processor speeds can last a little
while longer, but really fast top of the line processors can go for quite some time before dying and becoming unusable.
Real speed of processor

The CPU clock speed is a multiplier of the bus speed. This too affects things. But ultimately your
performance will depend on how finely tuned the whole system is. I/O will continue to be one of the slowest
aspects for the foreseeable future, so a faster hard drive might ultimately do more for you than a faster
CPU, but that too depends on what you're doing with it.
10 marks


Q-2) What is meant by 32-bit or 64 bit Processor?

Ans= In the personal computing world, 32-bit and 64-bit refer to the type of central processing unit, operating
system, driver, software program, etc. that utilizes that particular architecture.
32-bit hardware and software is often referred to as x86 or x86-32. 64-bit hardware and software is often referred to
as x64 or x86-64.
32-bit systems utilize data in 32-bit pieces while 64-bit systems utilize data in 64-bit pieces. In general, the more data
that can be processed at once, the faster the system can operate. There are several other advantages to a 64-bit
system as well, most practically the ability to use significantly greater amounts of physical memory.
Most new processors today are based on the 64-bit architecture and support 64-bit operating systems. These
processors are also fully compatible with 32-bit operating systems.
Most editions of Windows 8, Windows 7, andWindows Vista are available in 64-bit format. OnlyWindows XP Professional is
available in 64-bit. All editions of Windows 8, Windows 7, Windows Vista, and Windows XP are also available in 32-bit.

10 marks


Q-3) What are Translators?
A translator is a computer program that translates a program written in a given programming language into a functionally
equivalent program in a different language. Depending on the translator, this may involve changing or simplifying the
program flow, without losing the essence of the program, thereby producing a functionally equivalent program.
If the translator translates a high level language into another high level language, it's called a translator
If the translator translates a high level language into a lower level language it is called a compiler. Notice that every
language can be either translated into a (Turing-complete) high level or assembly language.
If the translator translates a high level language into an intermediate code which will be immediately executed it is called
an interpreter.
If the translator translates target/machine code to source language it is called a decompiler
If the translator translates assembly language to machine code it is called an assembler.
If the translator translates machine code into assembly language it is called a disassembler

10 marks


Q-4) What is record? Describe fixed and variable length records with suitable example.
10 marks
In computer science, a record-oriented filesystem is a file system where files are stored as collections of records. There
are several different record formats; the details vary depending on the particular system. In general the formats can be
fixed-length or variable length, with different physical organizations or padding mechanisms; metadata may be associated
with the file records to define the record length, or the data may be part of the record. Different methods to access records
may be provided, for example sequential, by key or by record number.
Fixed-Length Computer Records
A typical computer file consists of a set of records of equal length: i.e., records such that
each record consists of the same fixed number of bytes,
each record is made up of the same number of fields, and
each different type of field has the same number of bytes in every record.
Note that these restrictions allow different types of fields to have different numbers of
bytes. For example, suppose that each record contains a Social Security Number (SSN) field
and a telephone-number field (plus other fields that we ignore here). Each SSN field will
consist of 9 bytes; each telephone-number field, of 10 bytes. The kind of structure we have
just described is called a "fixed-length" record.
Fixed-length records work well for many applications. For example, consider a file used in a
company's accounting department to contain the information needed to prepare
employees' paychecks. The records in such a file would store information for the individual
employees of the company. Each record would need fields that contain such information as
SSN, hourly wage rate, number of income-tax withholding deductions claimed, number of
hours worked in the current week, number of hours of overtime worked in the current
week, total of wages paid to date in the calendar year, and total withheld to date in the
calendar year. Each such field will have a fixed length appropriate to the nature of the
information in the field; each record will contain the same number of fields; and, hence,
each record will be of the same fixed length as every other record in the file.
However, it should be clear that there are types of information that do not fit neatly in
fixed-length fields. For example, the title of a book can vary in length anywhere from one
byte to hundreds (or even thousands) of bytes; the surname and the first name(s) of an
author can vary ("Ann Lee" is much shorter than "Gustaf-Adolphus von Sachsen und
Coburg"), and a book (in LC cataloging practice) can have 1, 2, or 3 authors (i.e., there can
be a need for multiple fields for authors' names). As a moment's reflection will show, these
examples indicate that there can be serious problems in using fixed-length records to
handle certain types of data.
How could one design a title field for a fixed-length record for book data? Suppose we know
that some book titles can be as long as, say, 1492 characters. If we decide to provide 1492
bytes in a fixed-length field for titles, then the vast majority of titles, being much shorter
than 1492 bytes, will occupy only a small portion of the title field, the rest of which will have
to be filled with space characters. For most records, this would be a great waste of
computer-storage space and communications time. On the other hand, if we decide to
provide fewer than 1492 bytes for the title field, say 100 bytes, then we encounter another
problem: viz., although most titles will fit into a 100-byte field, there will still be some
wasted space with many titles, and, worse, some titles will have to be truncated to their first
100 characters (including space characters). (Furthermore, even the space-wasting 1492-
byte field might turn out to be too short for an extraordinary title.)
The same problem, and a related one, arise with the author field. First, it is clear that the
varying lengths of authors' names present the same problem as that of varying lengths of
titles. But there is a second problem, which stems from the fact that there can be 1, 2, or 3
authors of a book. If we include 3 author fields in every fixed-length record for a book, then
much of the time, there will be nothing in the 2nd author field and the 3rd author field but
space characters.
Variable-Length Computer Records
When the staff of the MARC pilot project began, in 1965, to consider how to handle catalog
data in computers, they immediately encountered the problems we have just outlined.
Furthermore, at that time, almost all computer files that had ever been designed or used
were of the fixed-length-record type. The MARC designers came up with a then-novel
solution: the variable-length record.
There are two basic ways of designing a variable-length record for computer use. The first
way is to mark, or delimit, the beginnings and endings (or, at a minimum, either the
beginning or the ending) of fields and records by special characters that are reserved for
that purpose. (Note: Almost all computer files, whether of fixed-length or variable-length
type, employ a special character to mark the end of the file. And many fixed-length-record
computer files use special end-of-record characters for convenience and as a safety measure
against error.) In order for a computer program to use a file of variable-length records with
variable-length fields (and, possibly, of varying numbers of occurrences of a given field),
the program must, as it opens the file, examine each successive character in the file to
determine whether the character is one of the special end-of-field or end-of -record
delimiters. Whenever a character is found to be a delimiter, the program knows it has
finished inputting a field or a record, and the program must take steps to handle the field or
record appropriately.
The second way of designing a variable-length record is to include, at the beginning of each
record, a special field, of fixed length, in which the lengths of all the variable-length fields in
the record are specified, but to use no special end-of-field or end-of-record characters. This
special field, usually called the "header", must itself be of fixed length so that the program
can quickly establish the nature of the structure of the whole record, including its variable-
length parts, by examining the contents of the header. Often the header, since it is of fixed
length, will also include certain fields that are known always to be of a fixed length (e.g., 4
digits for a year).
The MARC record uses both these ways of dealing with records of catalog information.
Before we consider at the MARC record format, however, we shall look at a example of each
way of handling variable-length records.


Q-5) Explain the array representation of list of memory with suitable example.
10 marks


Q-6) Explain the translation of a recursive procedure into a non recursive procedure.
10 marks


Q-7) Explain recursion. Give the recursive definition for the multiplication of natural numbers.
10 marks


Q-8) Explain the threaded binary tree and advantages of threaded binary tree.
10 marks


Q-9) Write an algorithm for binary search method.
10 marks


Q-10) What are the different techniques for searching ordered table? Explain any one?
10 marks

Das könnte Ihnen auch gefallen