Unit Write iterative and recursive C functions to find the greatest common divisor of two integers. [6]


 Gordon Shepherd
 1 years ago
 Views:
Transcription
1 Unit 1 1. Write the following statements in C : [4] Print the address of a float variable P. Declare and initialize an array to four characters a,b,c,d. 2. Declare a pointer to a function f which accepts integer as parameter and dose not return anything. 3. Read a string which will contain only alphabets. 4. Write a C program using pointers and functions to: [6] i. Read a string ii. Append a string to another string iii. Copy a string to another string. 5. Write iterative and recursive C functions to find the greatest common divisor of two integers. [6] 6. What is pointer in C? Write the output of the following code: [6] main() static int a[]=10,20,30,40,50; int *ptr=a; static int arr[2][2]=1,2,3,4; char str[]= ABCD * 4# ; char *s= str+2; int I,j; for(i=0;i<5,i++) printf( %d, * ptr++); for (i=0;i<2;i++) for(j=0;j<2;j++) printf( %d \,n, *(*(n+i)+j)); printf( %c\n%c\n%c\n, *(str + 2),*s++,*s);
2 7. Write a C program to count the number of special characters and lines in a text file and append it to same file. [6] 8. Differentiate between the following: [4] (i) Call by value and call by reference (ii) Structure and union. 9. What is similarity between structure, union and enumeration? [6] 10. What is Macro? What are its advantages and disadvantages. [6] 11. Write a C program to interchange two variables without using third variable. [4] 12. Describe about storage allocation and scope global, extern, static, local and register variables. [8] 13. What do you mean by type definition? Explain with example. [4] 14. Determine output of the following C statement: [4] main() int x=10,y=5,p,q; P=x>9; q=x>3 && y!=3; printf( p=% d,q= % d,p,q); main() int x; X= *8/5%10; printf( x=%d,x); 15. Write a recursive function to display nth element in Fibonacci series. With the help of stack contents give a trace of Fibonacci function by you for n=6; [6] 16. Explain the following with example with respect to files in C :[10] i. Fread ii. Fwrite iii. Fseek iv. Ftell v. Fopen 17. What is the difference between text files and binary files? [6]
3 18. Write C function to reverse the n numbers stored in one dimensional array. [5] 19. What is recursive function? Explain with example. [5] 20. Explain the following concept in C language with example.[8] (i)pointer (ii)call by value (iii)array of pointers (iv)structure 21. Write a C program to perform following operations on an array of integers of size n.using functions with parameters: [8] (i) Delete an element at a given position (ii) Count and display the prime numbers. 22. (a) Write output of code: [8] #include<stdio.h> #define N 5 int main( ) Int I,j,n=N; Int *p,list[]=10,20,30,40,50; Char name[][4]= ABC, BCD, CDE; Char (*q)[4]; P= &list[0]; Q=&name[0]; for(i=0;i<n;) print( %d \t %d \n,*(list+i++),*(p++)); for (j=0;j<3;j++) printf( %s \t %c\t%d\n,name[j],*(*(q)+j),name[j][0]); 23. Write a C program to read and store data about n machine parts in a file. The data of each machine part consists of a part
4 24. Machine part consist of a part number, name and quantity. Write a C function to display the total quantity of all parts and the part numbers having quantity less than given value.[8] 1. (a) Define the following terms: [4] Unit 2 i. Data structure ii. Pseudocode iii. Abstract data types iv. Big O notation 2. Write an algorithm to find the sum of integers in an array of size n and explain algorithm components with respect to your algorithm. [6] 3. Explain the classification of data structures with an example each [6]. 4. Give the basic statement constructs in an algorithm with example. [4] 5. Write iterative algorithm to find the factorial of a number. Determine the efficiency of your algorithm. [6] 6. Find the frequency count of each statement and each statement determine the time complexity of code given below: [6] Main() printf( %d,m); printf( %d,n); for (i=0;i<=m;i++) for(j=0;j<=n;j++) Count++; a+=b[count]; 7. Define Pointers? How do we declare the pointers?give its advantages. [6]
5 8. Diffrentiate between pass by reference and pass by value. [4] 9. Explain the effect of following statements: 1. int p,*p; 2. int q,*p=&q; 3. int(*p)++; 4. char *p; 5. int a=*p+5; 10. What is difference between null pointer and null macro? [6] 11. What are pointers really good for? [4] 12. What is recursion? Explain with example. [6] 13. Define algorithm? What are the characteristics of an algorithm? [6] 14. What is the frequency count of following: int fact(int n) int ans=1; while(n>=1) Ans=ans*n; N=n1; Return(ans);. 15. Find out complexity? Explain linear,non linear data structure,static and dynamic data structure. [4] 16. What is abstract data types?write An ADT for an array? [6] 17. Find frequency count of each step in code: int i,j; for(i=1;i<=n;i++) for (j=1;j<=n;j++) C[i][j]=a[i][j]+b[i][j]; 18. Explain Big O,Sigma and theta notation with example? [4]
6 19. Explain the following terms with example: i. Static data structure ii. Omega notation iii. Flow charts iv. Data object 20. Write an algorithm to find sum of odd and even int in an array of integers of size n. [8] 21. Determine the efficiency of algorithm for finding minimum number from list using frequency count. [8] 22. Give the classification of data structures with respect to memory allocation and relation between elements. [8] Unit 3 1. Write an ADT for polynomial. Write pseudocode for 2polynomial addition using arrays. Find out time complexity of it. [12] 2. Derive the formula to calculate the address of the element in onedimensional and twodimensional array using row major representation. [6] 3. Explain the steps of fast transpose algorithm for getting the transpose of sparse matrix having maximum m rows and n columns. What is the time complexity and space complexity of it? What are the advantages of fast transpose over simpletranspose? [10] 4. Write an ADT for sparse matrix. [4] 5. What is row major and column major storage representation methods of an array? [4] 6. What is call by value and call by reference? Explain with one example for each. [8] 7. Write a C program to shift elements of an integer array one location ahead. Element present at last location of array should be shifted on first location of the array. Write separate functions for accepting array, shifting array, displaying array etc. [8] 8. Explain execution of the following code step by step and show the final output : [8] # include < stdio.h > void display (int); int main( ) int x = 4;
7 display (x); return 0; void display (int n) if (n > 0) display (n 1); printf ( %d, n); 9. Write a C program to implement a structure for automobile part with data members part number, part name, quantity etc. Write separate functions for initializing structure, updating structure, displaying structure etc. [8] 10. Wtite polynomial as ADT.Represent the following polynomials using Array: 5x 11. Write Psedo C algorithm to find the fast transpose of a sparse matrix.analyse the time complexity of the algorithm.[6] 12. Derive the address calculation formula for multidimentional array, A[u1][u2]..[un] in row major and coloumn majior representation.[6] 13. Justify array as a linear data structure.write ADT for an array[6] 14. Write psedo c algorithm to add two polynomials represented using array and analyse the time complexity[6] 15. Explain the representation of sparse matrix with an example and state its advantages.[6] 16. Define time and space complexity of an algorithm[6] 17. Explain with the example linear data structure[6] 18. Define the following terms: [4] (i)data object (ii)data type 19. What is an abstract data type? [2] 20. Define data structure.what are different types of data structure? Explain.[8]
8 21. Explain different asymptotic notation.[4] 22. What do you mean by frequency count and its importance in the analysis of algorithm[6] UNIT 4 1. Write pseudocode for searching an element in a given array using linear search. What is the time complexity of linear search in best case, average case and worst case? Explain with example. [8] 2. Write a pseudocode for quicksort to sort a given array of n numbers. Show the contents of an array after each iteration for the following array : What is worst case and average case time complexity of quicksort? [8] 3. Write an algorithm for shell sort. Apply your algorithm to sort the following numbers in ascending order. Show the contents of an array after every iteration : What is time and space complexity of shell sort? [8] 4. Write pseudocode for Fibonacci search. Apply your algorithm on the following data to search numbers : 9, 100, 10. [8] Explain Generalized Linked List (GLL) with node structure in C. Represent the following using GLL : (a, b, c, (d, (e, f, c)), g), h, i). [10] 6. Write a function to create singly linked list which is sorted while creation. [6] 7. Explain in detail the concept of data object, data structures, linear data structure and nonlinear data structure. [8] 8. What is Asymptotic notation? Write an algorithm for matrix multiplication for n n matrix and find out its time complexity by frequency count. [8] 9. What is Abstract Data Type (ADT)? Write an abstract data type for linked list. [8]
9 10. Write an algorithm for Bubble sort. Find time complexity of the algorithm and express it using asymptotic notation. [8] 11. Sort the following numbers step by step by using Radix sort : [8] 20, 15, 21, 06, 08, 05, 29, 02, 14, Write an algorithm for binary search and find out its time complexity. [8] 13. Explain with one example index sequential search. [8] 14. Write a C program to implement quicksort. [8] 15. Give any two application of sorting and searching.[4] 16. Write psedo c algorithm for merge sort and determin its time Complexity.[6] 17. write psedo c algorithm to search an element using binary search and analyze its time complexity for best and worst cases.[6] 18. Write psedo C algorithm for insertion sort and determine its time complexity [6]. 19. Write the contents of list and each bucket,after each pass radix sort for the following list of numbers: 10,2,15,246,37,4,25,62,100,17. [6] 20. What is sort efficiency and sort stability?[4] 21. Compare the selection sort and inserton sort with respective to: [8] (i) Time Complexity (ii)passes(iii) Storage requirement (iv) Sort stability 22. Sort the following data in asending order using quick sort Show all passes with pivot: 56,12,84,56,28,0,13,47,94,31 [8] 23. Write the different application of sorting methods.[6] 24. Write psedo code for binary search with recursion.[6] 25. What is bubble sort? Explain with example [4] Unit 5 1. Explain Generalized Linked List (GLL) with node structure in C. Represent the following using GLL : (a, b, c, (d, (e, f, c)), g), h, i). [10] 2. Write a function to create singly linked list which is sorted while creation. [6] 3. Represent the following polynomial equation in Generalized Linked List (GLL) :
10 10x4y10z3 + 4x7y10z3 + 5x7y10z3 + x3y10z2 + 8x3y10z2 + 8y10. Also give the importance of the tag field in this representation. [8] 4. Write short note on garbage collection and compaction. [4] 5. Write a function to display the singly linked list in reverse without creating new. [4] 6. Show how a twodimensional array is stored in memory. Assume that array start at the address [4] 7. Explain how a polynomial is represented using array with one example. [5] 8. Write an algorithm for fast transpose of sparse matrix and find out its time complexity. [9] 9. Write a C program to implement polynomial using array and perform its multiplication. (Write separate functions for accepting polynomial, multiplication, display). [10] 10. What is sparse matrix? Explain with one example. [4] 11. (ii) What is address of element arr[4] [3] in the array arr of size 6 6 and type integer, when arr is represented using row major and column major representations? Assume array arr starts at the address What is static memory allocation and dynamic memory allocation? [4] 13. Compare doubly linked list and circular linked list. [4] 14. Write an algorithm to delete and insert a node in doubly linked list at any position. [8] 15. What is skep list? Explain with one example. [4] 16. Draw GLL for the following expression : [4] (a, b, (c, d, (e, f), g, (h, i), ((j, k)), l), m) 17. What a C program to implement circular linked list and display the contents in reverse order. (Write separate functions for create and display) [8] 18. What do you mean by dynamic memory allocation?how is it done in c?[4] 19. Write c Function for create, insert at end,delete a given node and display list,operations on a singly linked list.[6] 20. Write a C function to concatenate two circular linked list.[6] 21. Represent the following polynomial using circular linked list: (i)12x 62x 53x + 10 (ii)3x7 + 5x 2 + 2x [4] 22. What is Doubly linked list? Explain any two application of doubly linked list.[6]
11 23. Write C function for the following operations by choosing appropriate linked list: (i)to search a given element in list (ii) to traverse the list from any node. 24. Represent the following polynomial using arrays: (i)x 3 + 2xy 5  y 3 y +x (ii)5x 210xyy Write a short note on Storage representation of order list.[6] 26. Write Pseudo C algorithm for addition of two polynomials [8] 27. Explain with the example simple and fast transpose [8] Unit 6 1. Write a short note on Josephus problem. [4] 2. Write an ADT for stack. [4] 3. Convert the following infix expression into postfix expression by showing the contents of stack for every iteration : ((A/B Ù C) + (D * E)) (A * F)). Evaluate the postfix expression obtained for A = 9, B = 3, C = 2, D = 3, E = 17, F = 3. [10] 4. List any four applications of stack and explain any one of them. [4] 5. Explain the concept of multistack with example. [4] 6. Convert the following postfix expression to infix and prefix using stack. Show the contents of stack at every stage : abcde Evaluate given postfix expression for a = 50, b = 3, c = 4, d = 2, e = 1. [10]. 7. Sort the following numbers step by step by using Radix sort : [8] 20, 15, 21, 06, 08, 05, 29, 02, 14, Write an algorithm for binary search and find out its time complexity. [8] 9. Define stack.write algorithms for operation on a stack represented using array.[6] 10. Write pseudo C algorithms for operation on a stack represented using array[6] 11. Write psedo c algorithm to convert infix expression to postfix expression using linked stack.[6] 12. Write a c function to reverse a given string using stack. check a given is palindrome or not, using this function.[6]
12 13. Define queue.write linear queue as ADT using linked organization.[6] 14. How the circular queue solves the problem in linear queue?give the representation of circular queue using array and linked list.[6] 15. Write short note on the following: [6] (i) Queue Simulation (ii) Priority Queue 16. Write C pseudo code to insert and delete an element from singly linked list [6] 17. compare linked list with arrays with reference to the following aspects: (i) accessing any element randomly (ii) insertion and deletion of an element (iii) utilization of computer [6] 18. Discuss the application of circular singly linked list in detail[6] 19. Write comparison between sequential linked organization with linked organization [6] 20. Represent the following GLL: (i) G=((a,b)((c,d),e)) (ii)(p,q(r,s(t,u,v),w)x,u)[6] 21. Write C function that removes all duplicates element from SLL.[6]
DATA STRUCTURES USING C
DATA STRUCTURES USING C QUESTION BANK UNIT I 1. Define data. 2. Define Entity. 3. Define information. 4. Define Array. 5. Define data structure. 6. Give any two applications of data structures. 7. Give
More information10CS35: Data Structures Using C
CS35: Data Structures Using C QUESTION BANK REVIEW OF STRUCTURES AND POINTERS, INTRODUCTION TO SPECIAL FEATURES OF C OBJECTIVE: Learn : Usage of structures, unions  a conventional tool for handling a
More informationPES Institute of TechnologyBSC QUESTION BANK
PES Institute of TechnologyBSC Faculty: Mrs. R.Bharathi CS35: Data Structures Using C QUESTION BANK UNIT I BASIC CONCEPTS 1. What is an ADT? Briefly explain the categories that classify the functions
More informationVALLIAMMAI ENGINEERING COLLEGE SRM NAGAR, KATTANKULATHUR 603 203 DEPARTMENT OF COMPUTER APPLICATIONS QUESTION BANK IN REVISED BLOOM S TAXONOMY
ACADEMIC YEAR: 0 7 VALLIAMMAI ENGINEERING COLLEGE SRM NAGAR, KATTANKULATHUR 0 0 SEMESTER: ODD BRANCH: MCA YEAR: I SEMESTER: I SUBJECT CODE AND NAME: MC70 Problem Solving and Programming NAME OF THE FACULTY
More informationData Structure [Question Bank]
Unit I (Analysis of Algorithms) 1. What are algorithms and how they are useful? 2. Describe the factor on best algorithms depends on? 3. Differentiate: Correct & Incorrect Algorithms? 4. Write short note:
More informationCS 6202 PROGRAMMING & DATA STRUCTURESI PARTB UNITI ANNA UNIVERSITY QUESTIONS
PARTB UNITI 1. Write a function that returns a pointer to the maximum value of an array of double s.if the array is empty,return null? (8) Double*maximum(double*a,int size); 2. Write a c program to find
More information1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++
Answer the following 1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++ 2) Which data structure is needed to convert infix notations to postfix notations? Stack 3) The
More informationKrishna Institute of Engineering & Technology, Ghaziabad Department of Computer Application MCA213 : DATA STRUCTURES USING C
Tutorial#1 Q 1: Explain the terms data, elementary item, entity, primary key, domain, attribute and information? Also give examples in support of your answer? Q 2: What is a Data Type? Differentiate
More informationGUJARAT TECHNOLOGICAL UNIVERSITY, AHMEDABAD, GUJARAT. Course Curriculum. DATA STRUCTURES (Code: 3330704)
GUJARAT TECHNOLOGICAL UNIVERSITY, AHMEDABAD, GUJARAT Course Curriculum DATA STRUCTURES (Code: 3330704) Diploma Programme in which this course is offered Semester in which offered Computer Engineering,
More informationUNIT1 PARTA UNIT2 PARTA
UNIT1 1. Define computer? 2. Discuss briefly about input and output devices? 3. What is a RAM? 4. What is arom? 5. What is a compiler? 6. Write about a linker? 7. List any 5 key wordsof c? 8. Illustrate
More informationFBCA02 April2007 Programming in C Language BCA102 (New Course)
Seat No. : FBCA02 April2007 Programming in C Language BCA102 (New Course) Time : 3 Hours] [Max. Marks : 70 Instructions : (1) Figures to the right indicate full marks of the question. (2) Make and state
More information5. A full binary tree with n leaves contains [A] n nodes. [B] log n 2 nodes. [C] 2n 1 nodes. [D] n 2 nodes.
1. The advantage of.. is that they solve the problem if sequential storage representation. But disadvantage in that is they are sequential lists. [A] Lists [B] Linked Lists [A] Trees [A] Queues 2. The
More informationBhakta Kavi Narsinh Mehta University, Junagadh
Bhakta Kavi Narsinh Mehta University, Junagadh Draft Syllabus for B.Sc. (Computer Science) Bachelor of Science (Computer Science) (Semester  1) Effective From June  2016 B.Sc. (C.S.) (Semester  1) CS101:
More informationData Structure. Lecture 3
Data Structure Lecture 3 Data Structure Formally define Data structure as: DS describes not only set of objects but the ways they are related, the set of operations which may be applied to the elements
More informationCOMPUTER SCIENCE. Paper 1 (THEORY)
COMPUTER SCIENCE Paper 1 (THEORY) (Three hours) Maximum Marks: 70 (Candidates are allowed additional 15 minutes for only reading the paper. They must NOT start writing during this time) 
More informationDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING LESSON PLAN
ERODE SENGUNTHAR ENGINEERING COLLEGE (Approved by AICTE, New Delhi, Permanently Affiliated to Anna University  Chennai & Accredited by NAAC & National Board of Accreditation (NBA), New Delhi, Accredited
More informationM3R4: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE
M3R4: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE NOTE: IMPORTANT INSTRUCTIONS: 1. Question Paper in English and Hindi and Candidate can choose any one language. 2. In case of discrepancies in
More informationMLR Institute of Technology
MLR Institute of Technology DUNDIGAL 500 043, HYDERABAD COMPUTER SCIENCE AND ENGINEERING Computer Programming Lab List of Experiments S.No. Program Category List of Programs 1 Operators a) Write a C program
More information2013 Five years Integrated M.Sc.(IT) Semester 1 060010101  Fundamentals of Programming
03 Five years Integrated M.Sc.(IT) Semester 00000  Fundamentals Programming File should contain. Problem Statement. Algorithm 3. Flowchart. Program in C language(code) 5. Output and sample calculation
More informationAP Computer Science Java Mr. Clausen Program 9A, 9B
AP Computer Science Java Mr. Clausen Program 9A, 9B PROGRAM 9A I m_sort_of_searching (20 points now, 60 points when all parts are finished) The purpose of this project is to set up a program that will
More informationAP Computer Science AB Syllabus 1
AP Computer Science AB Syllabus 1 Course Resources Java Software Solutions for AP Computer Science, J. Lewis, W. Loftus, and C. Cocking, First Edition, 2004, Prentice Hall. Video: Sorting Out Sorting,
More informationSample Questions Csci 1112 A. Bellaachia
Sample Questions Csci 1112 A. Bellaachia Important Series : o S( N) 1 2 N N i N(1 N) / 2 i 1 o Sum of squares: N 2 N( N 1)(2N 1) N i for large N i 1 6 o Sum of exponents: N k 1 k N i for large N and k
More informationKITES TECHNOLOGY COURSE MODULE (C, C++, DS)
KITES TECHNOLOGY 360 Degree Solution www.kitestechnology.com/academy.php info@kitestechnology.com technologykites@gmail.com Contact:  8961334776 9433759247 9830639522.NET JAVA WEB DESIGN PHP SQL, PL/SQL
More information12 Abstract Data Types
12 Abstract Data Types 12.1 Source: Foundations of Computer Science Cengage Learning Objectives After studying this chapter, the student should be able to: Define the concept of an abstract data type (ADT).
More informationAnalysis of a Search Algorithm
CSE 326 Lecture 4: Lists and Stacks 1. Agfgd 2. Dgsdsfd 3. Hdffdsf 4. Sdfgsfdg 5. Tefsdgass We will review: Analysis: Searching a sorted array (from last time) List ADT: Insert, Delete, Find, First, Kth,
More informationUNIVERSITI MALAYSIA SARAWAK KOTA SAMARAHAN SARAWAK PSD2023 ALGORITHM & DATA STRUCTURE
STUDENT IDENTIFICATION NO UNIVERSITI MALAYSIA SARAWAK 94300 KOTA SAMARAHAN SARAWAK FAKULTI SAINS KOMPUTER & TEKNOLOGI MAKLUMAT (Faculty of Computer Science & Information Technology) Diploma in Multimedia
More informationML for the Working Programmer
ML for the Working Programmer 2nd edition Lawrence C. Paulson University of Cambridge CAMBRIDGE UNIVERSITY PRESS CONTENTS Preface to the Second Edition Preface xiii xv 1 Standard ML 1 Functional Programming
More informationQuestions 1 through 25 are worth 2 points each. Choose one best answer for each.
Questions 1 through 25 are worth 2 points each. Choose one best answer for each. 1. For the singly linked list implementation of the queue, where are the enqueues and dequeues performed? c a. Enqueue in
More informationSANKALCHAND PATEL COLLEGE OF ENGINEERING, VISNAGAR ODD/EVEN ACADEMICSEMESTER (201415) ASSIGNMENT / QUESTION BANK (2110003) [F.Y.B.E.
SANKALCHAND PATEL COLLEGE OF ENGINEERING, VISNAGAR ODD/EVEN ACADEMICSEMESTER (201415) ASSIGNMENT / QUESTION BANK Subject: Computer Programming and Utilization (2110003) [F.Y.B.E.: ALL BRANCHES] Unit 1
More informationData Structures. Level 6 C30151. www.fetac.ie. Module Descriptor
The Further Education and Training Awards Council (FETAC) was set up as a statutory body on 11 June 2001 by the Minister for Education and Science. Under the Qualifications (Education & Training) Act,
More informationFundamentals of Computer & Programming in C Shortanswer type questions
Fundamentals of Computer & Programming in C Shortanswer type questions Section A i. What is a computer system? Draw the block diagram of computer. ii. Differentiate between Real Time Operating System
More informationWriting programs to solve problem consists of a large. how to represent aspects of the problem for solution
Algorithm Efficiency & Sorting Algorithm efficiency BigO notation Searching algorithms Sorting algorithms 1 Overview 2 If a given ADT (i.e. stack or queue) is attractive as part of a solution How will
More informationComp 245 Data Structures. Stacks
Comp 245 Data Structures Stacks What is a Stack? A LIFO (last in, first out) structure Access (storage or retrieval) may only take place at the TOP NO random access to other elements within the stack An
More informationBCS2B02: OOP Concepts and Data Structures Using C++
SECOND SEMESTER BCS2B02: OOP Concepts and Data Structures Using C++ Course Number: 10 Contact Hours per Week: 4 (2T + 2P) Number of Credits: 2 Number of Contact Hours: 30 Hrs. Course Evaluation: Internal
More informationCHAPTER 4 ESSENTIAL DATA STRUCTRURES
CHAPTER 4 ESSENTIAL DATA STRUCTURES 72 CHAPTER 4 ESSENTIAL DATA STRUCTRURES In every algorithm, there is a need to store data. Ranging from storing a single value in a single variable, to more complex
More informationC programming: exercise sheet L2STUE (20112012)
C programming: exercise sheet L2STUE (20112012) Algorithms and Flowcharts Exercise 1: comparison Write the flowchart and associated algorithm that compare two numbers a and b. Exercise 2: 2 nd order
More informationC++ How to Program, 8/e by Pearson Education, Inc. All Rights Reserved.
C++ How to Program, 8/e 19922012 by Pearson Education, Inc. 19922012 by Pearson Education, Inc. 19922012 by Pearson Education, Inc. We ve studied fixedsize data structures such as onedimensional arrays
More informationB.Sc.(Computer Science) and. B.Sc.(IT) Effective From July 2011
NEW Detailed Syllabus of B.Sc.(Computer Science) and B.Sc.(IT) Effective From July 2011 SEMESTER SYSTEM Scheme & Syllabus for B.Sc. (CS) Pass and Hons. Course Effective from July 2011 and onwards CLASS
More informationSyllabus for Computer Science. Proposed scheme for B.Sc Programme under Choice Based Credit System
Syllabus for Computer Science Proposed scheme for B.Sc Programme under Choice Based Credit System SEMESTER  I Code Course Title Course Type HPW Credits BS106 SEMESTER I I BS 206 SEMESTER III BS 301
More informationBinary Heap Algorithms
CS Data Structures and Algorithms Lecture Slides Wednesday, April 5, 2009 Glenn G. Chappell Department of Computer Science University of Alaska Fairbanks CHAPPELLG@member.ams.org 2005 2009 Glenn G. Chappell
More informationBHARATHIAR UNIVERSITY: COIMBATORE CENTRE FOR COLLABORATION OF INDUSTRY AND INSTITUTIONS(CCII) CERTIFICATE IN ADVANCED PROGRAMMING C++ LANGUAGE
Certificate in Advanced Programming  C++ Language Page 1 of 7 BHARATHIAR UNIVERSITY: COIMBATORE 641046 CENTRE FOR COLLABORATION OF INDUSTRY AND INSTITUTIONS(CCII) CERTIFICATE IN ADVANCED PROGRAMMING C++
More informationData Structure and Algorithm I Midterm Examination 120 points Time: 9:10am12:10pm (180 minutes), Friday, November 12, 2010
Data Structure and Algorithm I Midterm Examination 120 points Time: 9:10am12:10pm (180 minutes), Friday, November 12, 2010 Problem 1. In each of the following question, please specify if the statement
More informationStack & Queue. Darshan Institute of Engineering & Technology. Explain Array in detail. Row major matrix No of Columns = m = u2 b2 + 1
Stack & Queue Explain Array in detail One Dimensional Array Simplest data structure that makes use of computed address to locate its elements is the onedimensional array or vector; number of memory locations
More informationAbstract Data Type. EECS 281: Data Structures and Algorithms. The Foundation: Data Structures and Abstract Data Types
EECS 281: Data Structures and Algorithms The Foundation: Data Structures and Abstract Data Types Computer science is the science of abstraction. Abstract Data Type Abstraction of a data structure on that
More information1. The memory address of the first element of an array is called A. floor address B. foundation addressc. first address D.
1. The memory address of the first element of an array is called A. floor address B. foundation addressc. first address D. base address 2. The memory address of fifth element of an array can be calculated
More informationIntroduction to Data Structures
Introduction to Data Structures Albert Gural October 28, 2011 1 Introduction When trying to convert from an algorithm to the actual code, one important aspect to consider is how to store and manipulate
More informationData Structure with C
Subject: Data Structure with C Topic : Tree Tree A tree is a set of nodes that either:is empty or has a designated node, called the root, from which hierarchically descend zero or more subtrees, which
More informationCOMPUTER SCIENCE 1999 (Delhi Board)
COMPUTER SCIENCE 1999 (Delhi Board) Time allowed: 3 hours Max. Marks: 70 Instructions: (i) All the questions are compulsory. (ii) Programming Language: C++ QUESTION l. (a) Why main function is special?
More informationA3R4: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE. Write a program to find sum of all prime numbers between 100 and 500.
A3R4: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE Assignment 1. Write a program to find sum of all prime numbers between 100 and 500. Assignment 2. Write a program to obtain sum of the first 10
More informationMarathwada Institute of Technology
Marathwada Institute of Technology Master of Computer Application Title of the subject: Object Oriented Programming using C++ Course Code: MCA 101 Faculty: Shubhashree Savant Class: FY MCA Part  I (Question
More informationTo My Parents Laxmi and Modaiah. To My Family Members. To My Friends. To IIT Bombay. To All Hard Workers
To My Parents Laxmi and Modaiah To My Family Members To My Friends To IIT Bombay To All Hard Workers Copyright 2010 by CareerMonk.com All rights reserved. Designed by Narasimha Karumanchi Printed in
More informationBangalore University B.Sc Computer Science Syllabus ( Semester System)
Bangalore University B.Sc Computer Science Syllabus ( Semester System) First Semester CSIT1: Computer Fundamentals and C Programming CSIP1: C Programming Lab Second Semester CSIIT1: Data Structures and
More informationI PUC  Computer Science. Practical s Syllabus. Contents
I PUC  Computer Science Practical s Syllabus Contents Topics 1 Overview Of a Computer 1.1 Introduction 1.2 Functional Components of a computer (Working of each unit) 1.3 Evolution Of Computers 1.4 Generations
More informationUNIT III: 1. What is an array? How to declare and initialize arrays? Explain with examples
UNIT III: Arrays: Introduction, Onedimensional arrays, Declaring and Initializing arrays, Multidimensional arrays. Strings: Introduction to Strings, String operations with and without using String handling
More information3) Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?
Freshers Club Important 100 C Interview Questions & Answers 1) How do you construct an increment statement or decrement statement in C? There are actually two ways you can do this. One is to use the increment
More informationData Structures and Data Manipulation
Data Structures and Data Manipulation What the Specification Says: Explain how static data structures may be used to implement dynamic data structures; Describe algorithms for the insertion, retrieval
More informationLecture 11 Doubly Linked Lists & Array of Linked Lists. Doubly Linked Lists
Lecture 11 Doubly Linked Lists & Array of Linked Lists In this lecture Doubly linked lists Array of Linked Lists Creating an Array of Linked Lists Representing a Sparse Matrix Defining a Node for a Sparse
More informationLab Manual. Data Structures (Pr): COT213 Data Structures (P): IT215
Lab Manual Data Structures (Pr): COT213 Data Structures (P): IT215 !" #$%&'() * +, . 951/6201617535973417*37311 235678976: ;7A
More informationWhat Is Recursion? Recursion. Binary search example postponed to end of lecture
Recursion Binary search example postponed to end of lecture What Is Recursion? Recursive call A method call in which the method being called is the same as the one making the call Direct recursion Recursion
More informationBasic Programming and PC Skills: Basic Programming and PC Skills:
Texas University Interscholastic League Contest Event: Computer Science The contest challenges high school students to gain an understanding of the significance of computation as well as the details of
More informationInternational Journal Of Engineering Research & Management Technology
International Journal Of Engineering Research & Management Technology ISSN: 23484039 September 2014 Volume 1, Issue5 Dynamic Implementation Using Linked List Karuna Department of Information and Technology
More informationAFF 826. Sub. Code 4BSO1C1. Sp2. B.Sc. DEGREE EXAMINATION, NOVEMBER First Semester. Software FUNDAMENTALS OF COMPUTERS AND C PROGRAMMING
Sp2 AFF 826 Sub. Code 4BSO1C1 B.Sc. DEGREE EXAMINATION, NOVEMBER 2015 First Semester Software FUNDAMENTALS OF COMPUTERS AND C PROGRAMMING (CBCS 2014 onwards) Time : 3 Hours Maximum : 75 Marks Part A (10
More informationAtmiya Infotech Pvt. Ltd. Data Structure. By Ajay Raiyani. Yogidham, Kalawad Road, Rajkot. Ph : 572365, 576681 1
Data Structure By Ajay Raiyani Yogidham, Kalawad Road, Rajkot. Ph : 572365, 576681 1 Linked List 4 Singly Linked List...4 Doubly Linked List...7 Explain Doubly Linked list: ...7 Circular Singly Linked
More informationBinary Search Trees. A Generic Tree. Binary Trees. Nodes in a binary search tree ( BST) are of the form. P parent. Key. Satellite data L R
Binary Search Trees A Generic Tree Nodes in a binary search tree ( BST) are of the form P parent Key A Satellite data L R B C D E F G H I J The BST has a root node which is the only node whose parent
More informationLecture 12 Doubly Linked Lists (with Recursion)
Lecture 12 Doubly Linked Lists (with Recursion) In this lecture Introduction to Doubly linked lists What is recursion? Designing a node of a DLL Recursion and Linked Lists o Finding a node in a LL (recursively)
More informationAlgorithms, Integers
CHAPTER 3 Algorithms, Integers 3.1. Algorithms Consider the following list of instructions to find the maximum of three numbers a, b, c: 1. Assign variable x the value of a. 2. If b > x then assign x the
More informationPseudo code Tutorial and Exercises Teacher s Version
Pseudo code Tutorial and Exercises Teacher s Version Pseudocode is an informal way to express the design of a computer program or an algorithm in 1.45. The aim is to get the idea quickly and also easy
More informationBACHELOR OF COMPUTER APPLICATIONS SEMESTER I
BACHELOR OF COMPUTER APPLICATIONS SEMESTER I Fundamentals and Windows Based Application Understanding Computers Computer: A Definition, Characteristics of Computers, Speed, Accuracy, Diligence, Versatility,
More informationThe Tower of Hanoi. Recursion Solution. Recursive Function. Time Complexity. Recursive Thinking. Why Recursion? n! = n* (n1)!
The Tower of Hanoi Recursion Solution recursion recursion recursion Recursive Thinking: ignore everything but the bottom disk. 1 2 Recursive Function Time Complexity Hanoi (n, src, dest, temp): If (n >
More informationMerge Sort. 2004 Goodrich, Tamassia. Merge Sort 1
Merge Sort 7 2 9 4 2 4 7 9 7 2 2 7 9 4 4 9 7 7 2 2 9 9 4 4 Merge Sort 1 DivideandConquer Divideand conquer is a general algorithm design paradigm: Divide: divide the input data S in two disjoint subsets
More informationModule 2 Stacks and Queues: Abstract Data Types
Module 2 Stacks and Queues: Abstract Data Types A stack is one of the most important and useful nonprimitive linear data structure in computer science. It is an ordered collection of items into which
More informationUnit 5: Recursion Part 3. Application of Recursion to Languages. Grammar. Engineering 4892: Data Structures. June 14, 2011
Unit 5: Recursion Part 3 1 Application of Recursion to Languages Engineering 4892: Data Structures 1 Application of Recursion to Linked Lists Faculty of Engineering & Applied Science Memorial University
More information6.087 Lecture 5 January 15, 2010
6.087 Lecture 5 January 15, 2010 Review Pointers and Memory Addresses Physical and Virtual Memory Addressing and Indirection Functions with Multiple Outputs Arrays and Pointer Arithmetic Strings String
More informationQuiz 4 Solutions EECS 211: FUNDAMENTALS OF COMPUTER PROGRAMMING II. 1 Q u i z 4 S o l u t i o n s
Quiz 4 Solutions Q1: What value does function mystery return when called with a value of 4? int mystery ( int number ) { if ( number
More informationOverview of Data Structures
UNIT 3 Concrete Data Types Classification of Data Structures Concrete vs. Abstract Data Structures Most Important Concrete Data Structures Arrays Records Linked Lists Binary Trees Overview of Data Structures
More informationGTU Questions. Computer Programming & Utilization. Chief Course Coordinator Prof. Mitul K.Patel. (Head of Department & Assistant Professor)
GTU Questions Computer Programming & Utilization Chief Course Coordinator Prof. Mitul K.Patel (Head of Department & Assistant Professor) Course Coordinator Prof. Vrutti D. Shah (Assistant Professor) Lab
More informationProgramming Assignments
Programming Assignments 1. A number is called an Armstrong number if the sum of the cubes of the digits of the number is equal to the number. For example 153 = 1^3 + 5^3 + 3^3. Write a C program that asks
More informationIMPERATIVE PROGRAMMING C LANGUAGE
J.NAWROCKI, M. ANTCZAK, H. ĆWIEK, W. FROHMBERG, A. HOFFA, M. KIERZYNKA, S. WĄSIK IMPERATIVE PROGRAMMING C LANGUAGE EX. 1. Write in C language programs described below, compile them and tentatively debug:
More informationSEARCHING AND SORTING
SEARCHING AND SORTING Searching A basic operation in computer science Problem formulation Given: Collection (array) of values A property on values Find: a value having the property in the array Examples
More informationClass Overview. CSE 326: Data Structures. Goals. Goals. Data Structures. Goals. Introduction
Class Overview CSE 326: Data Structures Introduction Introduction to many of the basic data structures used in computer software Understand the data structures Analyze the algorithms that use them Know
More informationSize = ub lb + 1. Note that the size of the array = ub if lb=1.
M21: INTRODUCTION: An array is a collection of homogenous data elements (ie elements of same type) described by a single name Each element of an array is referenced by a subscripted variable enclosed in
More informationStacks. Linear data structures
Stacks Linear data structures Collection of components that can be arranged as a straight line Data structure grows or shrinks as we add or remove objects ADTs provide an abstract layer for various operations
More informationCommon Data Structures
Data Structures 1 Common Data Structures Arrays (single and multiple dimensional) Linked Lists Stacks Queues Trees Graphs You should already be familiar with arrays, so they will not be discussed. Trees
More informationENGINEERING PROBLEM SOLVING WITH C++
ENGINEERING PROBLEM SOLVING WITH C++ Third Edition Delores M. Etter Electrical Engineering Department Southern Methodist University, Dallas, TX Jeanine A. Ingber Accurate Solutions in Applied Physics,
More informationPARTA Questions. 2. How does an enumerated statement differ from a typedef statement?
1. Distinguish & and && operators. PARTA Questions 2. How does an enumerated statement differ from a typedef statement? 3. What are the various members of a class? 4. Who can access the protected members
More informationMini Projects List
Mini Projects List 1. Develop a mini project in C language using functions to perform the following operations a. Defining a user define function to copy one string into anther string b. Define a user
More informationConcise Notes on Data Structures and Algorithms
Concise Notes on Data Structures and Algorithms Ruby Edition Christopher Fox James Madison University 2011 Contents 1 Introduction 1 What Are Data Structures and Algorithms?.................................
More informationAS2261 M.Sc.(First Semester) Examination2013 Paper fourth SubjectData structure with algorithm
AS2261 M.Sc.(First Semester) Examination2013 Paper fourth SubjectData structure with algorithm Time: Three Hours] [Maximum Marks: 60 Note Attempts all the questions. All carry equal marks Section A
More informationSorting and Searching
Sorting and Searching Lecture A Tiefenbruck Tu, Th 11am12:20pm Center 119 Lecture B Tiefenbruck Tu, Th 9:30am10:50am Center 119 Lecture C Minnes Tu, Th 3:30pm4:50pm WLH 2005 http://cseweb.ucsd.edu/classes/fa15/cse21abc/
More informationComp Arrays and Pointers. Class Notes. T h e G r o u p o f T h r e e
Comp 2401 Arrays and Pointers Class Notes 2013 T h e G r o u p o f T h r e e Introduction To Arrays: In C programming, one of the frequently problem is to handle similar types of data. For example: if
More informationData Structures, Sample Test Questions for the Material after Test 2, with Answers
Data Structures, Sample Test Questions for the Material after Test 2, with Answers 1. Recall the public interfaces of classes List and ListIterator: typedef int ListItemType; class ListIterator{ public:
More informationLinked Lists, Stacks, Queues, Deques. It s time for a chainge!
Linked Lists, Stacks, Queues, Deques It s time for a chainge! Learning Goals After this unit, you should be able to... Differentiate an abstraction from an implementation. Define and give examples of problems
More informationThis page intentionally left blank
This page intentionally left blank Copyright 2006, New Age International (P) Ltd., Publishers Published by New Age International (P) Ltd., Publishers All rights reserved. No part of this ebook may be
More informationC Programming 1. C Programming
C Programming 1 1 C Programming 1. Who developed the C language? Dennis M.Ritchie in 1972 2. What type of language is C? Semihigh level language 3. What is main()? The main() is a special function used
More informationIn the example above, it is as though the elements are in twodimensions such a table
2 1 3 2 4 4 5 5 6 6 7 8 9 10 11 12 13 MultipleDimensional Arrays Elements of arrays may have more than one index, i.e. In example above, it is as though elements are in twodimensions such a table with
More informationC Primer. Fall Introduction C vs. Java... 1
CS 33 Intro Computer Systems Doeppner C Primer Fall 2016 Contents 1 Introduction 1 1.1 C vs. Java.......................................... 1 2 Functions 1 2.1 The main() Function....................................
More informationBasic Common Unix commands: Change to directory d
Basic Common Unix commands: cd d Change to directory d mkdir d rmdir d mv f1 [f2...] d mv d1 d2 ls [d] [f...] ls 1 [f...] vi [f] emacs [f] more f cp f1 f2 mv f1 f2 rm f gcc [o f1] f2 gnuplot Create new
More informationStrings in C++ and Java. Questions:
Strings in C++ and Java Questions: 1 1. What kind of access control is achieved by the access control modifier protected? 2 2. There is a slight difference between how protected works in C++ and how it
More informationCurriculum Map. Discipline: Computer Science Course: C++
Curriculum Map Discipline: Computer Science Course: C++ August/September: How can computer programs make problem solving easier and more efficient? In what order does a computer execute the lines of code
More informationChapter 17 Recursion
Chapter 17 Recursion What is Recursion? A recursive function is one that solves its task by calling itself on smaller pieces of data. Similar to recurrence function in mathematics. Like iteration  can
More information